zdesam
zdesam

Reputation: 2976

Paypal shopping cart with Adaptive Chained Payment

I am currently using my own cart and sending whole cart items to paypal for payment so that seller can see on their paypal account on what items were sold and this is working pretty good.

Now I want the same result but with adaptive chained payment. I can use the adaptive chained payment and pass the amount to primary receiver and secondary receivers, but since my primary receiver is the actual seller, I also want the cart items to be sent so that the seller still can see the items sold on his paypal account.

I hope you understand my questions. I just want to know how adaptive chained payment can be used along with paypal shopping cart.

Thanks

Upvotes: 1

Views: 478

Answers (1)

Josh Stuart
Josh Stuart

Reputation: 1528

As far as I know this cannot be achieved with the Adaptive Payments API.

There is a memo field that can be used to add dynamic text, which in your case could be product details such as sku, name, brand etc.

See https://www.x.com/developers/paypal/documentation-tools/api/pay-api-operation#id098QF000M7Q

Some pseudo code:

$payRequest = new \PayRequest();

$payRequest->actionType = 'PAY';
$payRequest->cancelUrl = 'http://yourapp.com/cancel';
$payRequest->ipnNotificationUrl =  'http://yourapp.com/ipn';
$payRequest->returnUrl =  'http://yourapp.com/complete';
$payRequest->trackingId = '123';
$payRequest->clientDetails = new \ClientDetailsType();
$payRequest->clientDetails->applicationId = 'app-id-123';
$payRequest->clientDetails->ipAddress = $_SERVER['REMOTE_ADDR'];
$payRequest->currencyCode = 'USD';
$payRequest->reverseAllParallelPaymentsOnError = true;

//Add product/order details to the memo field
$payRequest->memo = 'Nike Air Force 1s x 1';

Upvotes: 1

Related Questions