Im using the ci-merchant library ci-merchant and it all works fine except that Im just passing the order total to paypal.
Is there a way to specify the shipping amount, and /or other custom attributes so when customers get referred to Paypal there is an itemized list so they know what they are paying for.
This is my existing code:
$params = array(
'amount' => 50.00,
'currency' => 'USD',
'return_url' => 'mysite.com/return/' . $order_id,
'notify_url' => 'mysite.com/notify/' . $order_id,
);
$response = $this->merchant->purchase($params);
What I would like to do is something like:
$params = array(
'amount' => 40.00,
'shipping' => 10.00,
'currency' => 'USD',
'return_url' => 'mysite.com/return/' . $order_id,
'notify_url' => 'mysite.com/notify/' . $order_id,
);
$response = $this->merchant->purchase($params);
Modify a file into the library like specified here, and it allows you to pass an array of items with the classic data required when calling purchase() method.
The array is formatted like this :
$params = array(
'amount' => 40.00,
'currency' => 'USD',
'return_url' => 'mysite.com/return/' . $order_id,
'notify_url' => 'mysite.com/notify/' . $order_id,
'items' => array(
array(
'name'=>'',
'desc'=>'',
'amt'=>,
'qty'=>
)
)
);
But remember that ci-merchant is no longer supported. You better use Omnipay.