making multiple recurring payments using .net api

sam_dotcentric
Contributor
Contributor

Hi,

 

I am working on a website that allows users to purchase sponsorships (recurring payments) for a charity using paypal. It is possible for a user to add multiple sponsorship items to their basket and checkout. The current version of the code throws an error when you try to make more than one recurring payment. The first time DoExpressCheckoutPayment is called we get a success but every subsequent request returns an error. The error message (code 11456) says that the token has already been used, which makes sense because the code has been written to make multiple separate requests using the same token.

 

I am trying to re-write the code to fix this bug but i can't find any examples of code that make *multiple* recurring payments. The only two options i can see so far are:

 

1. put all the recurring payments together in a single request to DoExpressCheckoutPayment, which is not going to be acceptable to the website owners because separate sponsorships need to be shown as separate items to the customer in paypal and this approach means that all recurring payments in the list are grouped into a single recurring payment item (if i purchase 3 sponsorships at £10 each paypal is showing a single recurring donation of £30).

 

2. make a separate call to SetExpressCheckout for each recurring payment item so that each can be passed to DoExpressCheckoutPayment with a different token. This is also not likely to be popular with the website owners because this would mean that the customer would be redirected to the paypal screen to verify each separate payment.

 

Does anyone have an example of code that makes multiple separate recurring payments? Is it possible to do this in any way other than the two options i have summarised above?

 

If anyone can help me it would be greatly appreciated

 

 

thanks

 

Sam

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.