dimanche 19 février 2017

Adding custom variable to Omnipay Paypal Express

I have tried searching everywhere on the internet and cannot get anything out there to work.

I am trying to add the user id to my 'Paypal_Express' Omnipay purchase.

However the solution outlined in http://ift.tt/2ll7kGU does not work for me. It says function sendData does not exist. $request->setTransactionId(); and $request->setDescription(); also throws an error.. Has anyone else been able to do this?

$order_paramaters = array(
'amount'       => $grand_total,
);

Omnipay::setParameter('custom', $cart->user_id);
$response = Omnipay::purchase($order_paramaters)->send();

I get:

call_user_func_array() expects parameter 1 to be a valid callback, cannot access protected method Omnipay\PayPal\ExpressGateway::setParameter()

Also tried:

$gateway = Omnipay::create('PayPal_Express');
$gateway->setParameter('custom', $cart->user_id);
$response = $gateway->purchase($order_paramaters)->send();

I get:

Call to protected method Omnipay\Common\AbstractGateway::setParameter() from context 'App\Http\Controllers\CartController'

Any help GREATLY appreciated.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lATouP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire