Testing the entire billing cycle in a sandbox

I am currently trying to implement a PayPal recursive payment, and I would like to check the "whole cycle". I found this article http://www.paypalobjects.com/en_US/ebook/PP_Sandbox_UserGuide/testing_recurringpayments.html , as well as some links in stackoverlfow that it should work. But for me it does not work. Maybe I need to delve into this code, but I was wondering if this should work?

I use https://github.com/thenbrent/paypal-digital-goods and I sign the following data:

$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 set the registration to my end of receiving notifications, but it only gets when creating a new profile.

+5
source share
1 answer

On a real site, the billing cycle is repeated after the actual specified time; for example, a one month billing cycle takes one month. You can simulate the elapsed time for a billing cycle in Sandbox when testing the recurring payment profile, in which case the actual elapsed time is reduced. This is useful if you want to simulate a billing cycle without waiting for the actual time to expire.

To reduce the actual elapsed time, you specify Day as a period. When you specify Day, a 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 the CreateRecurringPaymentsProfile API is executed, the billing cycle occurs every minute when testing in the Sandbox.

Reducing 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 period, without waiting for four months. In Sandbox, you can specify the following NVP parameters:

 ...&TRIALBILLINGPERIOD=Day&TRIALBILLINGFREQUENCY=3 ...&BILLINGPERIOD=Day&BILLINGFREQUENCY=1... 

In the Sandbox, a trial billing period will take approximately 3 minutes, and a regular billing cycle will occur approximately every minute. When you are ready to live, you will change the billing period and the billing period to a month.

If this does not work, send a request and a response to CreateRecurringBillingProfile, and we will consider it further.

+3
source

Source: https://habr.com/ru/post/914578/


All Articles