public function doExpressCheckoutPayment($data, $token, $payerid)
    {
        $this->setItemSubTotal($data);

        $this->post = $this->setCartItems($data['items'])->merge([
            'TOKEN'                          => $token,
            'PAYERID'                        => $payerid,
            'PAYMENTREQUEST_0_ITEMAMT'       => $this->subtotal,
            'PAYMENTREQUEST_0_AMT'           => $data['total'],
            'PAYMENTREQUEST_0_PAYMENTACTION' => !empty($this->config['payment_action']) ? $this->config['payment_action'] : 'Sale',
            'PAYMENTREQUEST_0_CURRENCYCODE'  => $this->currency,
            'PAYMENTREQUEST_0_DESC'          => $data['invoice_description'],
            'PAYMENTREQUEST_0_INVNUM'        => $data['invoice_id'],
            'PAYMENTREQUEST_0_NOTIFYURL'     => $this->notifyUrl,
        ]);

        $this->setShippingAmount($data);

        return $this->doPayPalRequest('DoExpressCheckoutPayment');
    }
public function doExpressCheckoutPayment($data, $token, $payerid)
    {
        $this->setItemSubTotal($data);

        $this->post = $this->setCartItems($data['items'])->merge([
            'TOKEN'                          => $token,
            'PAYERID'                        => $payerid,
            'PAYMENTREQUEST_0_ITEMAMT'       => $this->subtotal,
            'PAYMENTREQUEST_0_AMT'           => $data['total'],
            'PAYMENTREQUEST_0_PAYMENTACTION' => !empty($this->config['payment_action']) ? $this->config['payment_action'] : 'Sale',
            'PAYMENTREQUEST_0_CURRENCYCODE'  => $this->currency,
            'PAYMENTREQUEST_0_DESC'          => $data['invoice_description'],
            'PAYMENTREQUEST_0_INVNUM'        => $data['invoice_id'],
            'PAYMENTREQUEST_0_NOTIFYURL'     => $this->notifyUrl,
        ]);

        $this->setShippingAmount($data);

        return $this->doPayPalRequest('DoExpressCheckoutPayment');
    }
public function doExpressCheckoutPayment ( $ data , $ token , $ payerid ) { $ this -> setItemSubTotal ( $ data ) ; $ this -> post = $ this -> setCartItems ( $ data [ 'items' ] ) -> merge ( [ 'TOKEN' => $ token , 'PAYERID' => $ payerid , 'PAYMENTREQUEST_0_ITEMAMT' => $ this -> subtotal , 'PAYMENTREQUEST_0_AMT' => $ data [ 'total' ] , 'PAYMENTREQUEST_0_PAYMENTACTION' => ! empty ( $ this -> config [ 'payment_action' ] ) ? $ this -> config [ 'payment_action' ] : 'Sale' , 'PAYMENTREQUEST_0_CURRENCYCODE' => $ this -> currency , 'PAYMENTREQUEST_0_DESC' => $ data [ 'invoice_description' ] , 'PAYMENTREQUEST_0_INVNUM' => $ data [ 'invoice_id' ] , 'PAYMENTREQUEST_0_NOTIFYURL' => $ this -> notifyUrl , ] ) ; $ this -> setShippingAmount ( $ data ) ; return $ this -> doPayPalRequest ( 'DoExpressCheckoutPayment' ) ; }
Perform DoExpressCheckoutPayment API call on PayPal.

@param array  $data
@param string $token
@param string $payerid

@throws \Exception

@return array|\Psr\Http\Message\StreamInterface
Perform DoExpressCheckoutPayment API call on PayPal .