php - List multiple items through Paypal Express checkout using Omnipay & Laravel 4 -
is possible list products in sites "cart" on paypal. ask because paypal says "descriptions" instead of description , nicer having combined total unhelpful description of "your basket"
$request = $gateway->purchase([ 'amount' => '150.00', 'currency' => 'gbp', 'description' => 'your basket', 'returnurl' => 'http://localhost:8080/checkout/success', 'cancelurl' => 'http://localhost:8080/checkout/cancel' ])->send();
the documentation vague or may have overlooked possibility i've tried:
$request = $gateway->purchase([ 'amount' => array('100','200'), 'currency' => 'gbp', 'description' => array('prod1','prod2'), 'returnurl' => 'http://localhost:8080/checkout/success', 'cancelurl' => 'http://localhost:8080/checkout/cancel' ])->send();
&
$request = $gateway->purchase([data],[data])->send();
where data follows above layout.
i found post on github explains how achievable.
setitems
function added array of items can passed so:
$request = $gateway->purchase([ 'amount'=>'70.00', 'returnurl' => 'http://localhost:8080/checkout/success', 'cancelurl' => 'http://localhost:8080/checkout/cancel' ])->setitems(array( array('name' => 'item1', 'quantity' => 2, 'price' => '10.00'), array('name' => 'item2', 'quantity' => 1, 'price' => '50.00') ))->send();
something note
request fail if purchase amount not equal sum of array of items.
Comments
Post a Comment