简体   繁体   中英

Paypal Subscriptions ( payment agreement with mulitiple payment plans )

We have implemented paypal subscription payment. I have completed the following steps.

  1. Create a payment plan.
  2. Activate the plan
  3. Create a payment agreement.
  4. Get user signup to a specific agreement (Divert to agreement url)
  5. Execute the payment.

But my current project involves multiple subscriptions in one checkout. You can signup for 2 subscriptions with two different products and pay at once, but both products will be set to auto renew.

My issue is how can i achieve multiple subscriptions so user has to agree with only one payment agreement(One checkout). And later on they can switch on and off auto subscription for one product if they want to.

I have already tried the following.

$plan_1 = new Plan();
$plan_1->setId('P-****************');
$plan_2 = new Plan();
$plan_2->setId('P-************');
$agreement->setPlan($plan_1);
$agreement->setPlan($plan_2);

But an agreement can have only one plan apparently. I cannot pass two plans to one agreement. How can i do it so user has to visit paypal only once?

I doubt this is possible. When I dealt with Billing/Recurring agreements years ago, you had to set them up one at a time. This was to prevent abuse where someone could layer in multiple agreements.

The best I could suggest is to build everything into one plan and go from there. Modify the agreement if the user changes their agreement type/level.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM