Subscription Plan definition Using REST API PHP with Trial

amrroi
Contributor
Contributor

I have created the Subscription plan using REST API but plan defined only accepts payments without trial . Please check. I have provided some part of code.

$plan = new Plan();

$plan->setName('TESTR3')
->setDescription('TESTR3.')
->setType('fixed');

$paymentDefinition = new PaymentDefinition();

$paymentDefinition->setName('Regular Payments')
->setType('REGULAR')
->setFrequency('Month')
->setFrequencyInterval("1")
->setCycles("60")
->setAmount(new Currency(array('value' => 35, 'currency' => 'USD')));

 

$paymentDefinition->setName('Free trial payment definition')
->setType('TRIAL')
->setFrequency('Week')
->setFrequencyInterval("1")
->setCycles("1")
->setAmount(new Currency(array('value' => 0, 'currency' => 'USD')));

 

Please let me know how can i resolve this.

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.