1
votes

Hi fellow developpers,

I want to use REST API Billing Plans and Agreement to do the following application:

  • Create a recurring payment based on user's selected Billing Plan which includes a 30 days free trial.
  • The user can select from a month by month plan which costs $X or a yearly plan which costs $Y.
  • Both plans include a free 30 trial
  • Recurring payments should start automatically at the end of the 30 days trial

Now, I know I can create those 2 billing plans with respective amount/period/cycle, etc. My question is about the trial:

->> Can I create & execute a billing agreement based on the selected billing plan with a startDate that would be in 30 days from now ??

I saw the trial example in Paypal docs for the SOAP API but I really want to use the REST API and there is no clear answer right now!

Thanks guys! Jean

1
Yes, I've tested successfully that you can set the startDate to a future date and the billing agreement will handle it correctlybed007

1 Answers

0
votes

I'm not sure if this is correct or not, but I think that you would to include two PaymentDefinition objects in your plan. You'd include an additional PaymentDefinition for the trial and set the . Like such:

 PaymentDefinition paymentDefinition = new PaymentDefinition();
 paymentDefinition.setName("NAME");
 paymentDefinition.setType("TRIAL");
 paymentDefinition.setFrequency("DAY");
 paymentDefinition.setFrequencyInterval("30");
 paymentDefinition.setCycles("1");

 Currency currency = new Currency();
 currency.setCurrency("USD");
 currency.setValue("0.00");
 paymentDefinition.setAmount(currency);