开发者

How to pass item_number to IPN when using Adaptive Payment API call to make pay request on Paypal?

开发者 https://www.devze.com 2023-01-26 08:43 出处:网络
I am using adaptive api to make a chained payment. The code looks ChainedPay chainedPay = new ChainedPay(numberOfReceivers);

I am using adaptive api to make a chained payment. The code looks

ChainedPay chainedPay = new ChainedPay(numberOfReceivers); //set values (such as return url, cancel url, ipn url etc for the chainedPay object ....

Receiver primaryReceiver = new Receiver(); // set the receiver's value such as amount etc. ... chainedPay.setPrimaryReceiver(primaryReceiver);

Receiver rec1 = new Receiver(); //set the开发者_运维问答 second receiver's value ... chainedPay.addToSecondaryReceivers(rec1);

//Make the request chainedPay.makeRequest(); like this:

I do get the IPN message back when the payment is approved. But I want to be able to send a value such as a transactionId that exists in my system in the pay request, and have the IPN post it back to me, so I can look up the transaction by its id in my ipn listener, and use that information to deliver digital good to the user. I can't figure out where to set that value in the pay request.

Before using adaptive payment api call, if I want to pass the transaction id to the IPN, I would set it in the item_number field in a field in the form of the buy button and that would get passed through. Is there something similar in the adaptive api?

Thanks, Tim


Try using the trackingid parameter. I am using the XML version and I pass it as follows
sRequest.Append("</trackingId>");
sRequest.Append(trackingID);
sRequest.Append("</trackingId>"); You may get a property as tracking id in PayRequest class.


I am passing the orderId via the trackingId field in the PayRequest

Ex: PayRequest payRequest = new PayRequest(requestEnvelope, actionType, cancelUrl, currencyCode, receiverList, returnUrl); payRequest.ipnNotificationUrl = System.Configuration.ConfigurationManager.AppSettings["PaypalNotifyUrl"]; payRequest.trackingId = orderId.ToString();

Then in the IPN handler, I retrieve it from the Request object.

0

精彩评论

暂无评论...
验证码 换一张
取 消