Reputation: 510
I am currently trying to implement paypal recurring payment and I would like to test "whole cycle". I found this article http://www.paypalobjects.com/en_US/ebook/PP_Sandbox_UserGuide/testing_recurringpayments.html and also some references in stackoverlfow that it should work. But for me it does not seem to work. Maybe I have to dig into code for that but I was wondering should this actually work?
I am using https://github.com/thenbrent/paypal-digital-goods library and I subscription details are following:
$subscriptionDetails = array(
'description' => 'Subscription for $10/month for the next year.',
'initial_amount' => '10.00',
'amount' => '10.00',
'period' => 'Day',
'frequency' => '1',
'total_cycles' => '12',
);
$pay = new PayPal_Subscription( $subscriptionDetails );
I have put up logging at my notification receiving end but it only get's hit when I make new profile.
Upvotes: 5
Views: 4936
Reputation: 1888
On the live site, a billing cycle repeats after the actual specified time elapses; for example, a one month billing cycle takes one month to occur. You can simulate the elapsed time for a billing cycle in the Sandbox when testing a recurring payments profile, in which case the actual elapsed time is reduced. This is useful when you want to simulate a billing cycle without waiting for the actual time to elapse.
To reduce the actual elapsed time, you specify Day as the period. When you specify Day, the billing cycle occurs every n minutes in the Sandbox, where n represents the frequency; for example, if you specify 1 for the billing frequency and Day for the period when executing the CreateRecurringPaymentsProfile API, the billing cycle occurs every minute when testing in the Sandbox.
Reducing the elapsed time only works if the period is Day; other values do not change the actual elapsed time.
Consider a scenario in which you want to simulate a one-month billing cycle after a three-month trial, without waiting four months. In the Sandbox, you could specify the following NVP parameters:
...&TRIALBILLINGPERIOD=Day&TRIALBILLINGFREQUENCY=3
...&BILLINGPERIOD=Day&BILLINGFREQUENCY=1...
In the Sandbox, the trial billing period would take approximately 3 minutes and the regular billing cycle would occur approximately every minute. When you are ready to go live, you would change the trial billing period and the billing period to Month.
If this does not work, post your CreateRecurringBillingProfile request and response, and we can look into it further.
Upvotes: 3