質問

I'm getting a little bit confused in payapl BillingFrequency and BillingPeriod.

The paypal sites states that

BILLINGFREQUENCY: Number of billing periods that make up one billing cycle.

BILLINGPERIOD: The unit of measure for the billing cycle. Must be one of :Day,Week,SemiMonth,Month,Year

My question is how can I create recurring profiles for following 1. Once a month 2. Once after 3 months 3. Once after 6 months 4. Once a year

I've tried the following but still not sure if I'm right.. I cannot deploy the code for testing as the site is live.

    if(intval($subsType->validity) == 1)
    {
        $paymentBillingPeriod->BillingFrequency = 1;
        $paymentBillingPeriod->BillingPeriod = "Month";
        $paymentBillingPeriod->TotalBillingCycles = 0;
    }
    elseif(intval($subsType->validity) == 3)
    {
        $paymentBillingPeriod->BillingFrequency = 3;
        $paymentBillingPeriod->BillingPeriod = "Month";
        $paymentBillingPeriod->TotalBillingCycles = 0;
    }
    elseif(intval($subsType->validity) == 6)
    {
        $paymentBillingPeriod->BillingFrequency = 6;
        $paymentBillingPeriod->BillingPeriod = "Month";
        $paymentBillingPeriod->TotalBillingCycles = 0;
    }
    elseif(intval($subsType->validity) == 12)
    {
        $paymentBillingPeriod->BillingFrequency = 1;
        $paymentBillingPeriod->BillingPeriod = "Year";
        $paymentBillingPeriod->TotalBillingCycles = 0;
    }
役に立ちましたか?

解決

First, you need to setup a separate test site for your live site. Just like PayPal does with sandbox.paypal.com, you can create a sandbox.yourdomain.com and develop everything there against the PayPal sandbox. Then move the code to your www.yourdomain.com when you know it's ready.

As for your samples here, I'm a little confused by your wording.

1) This one you've got correct. It would do once per month indefinitely until canceled.

2) If you really mean ONCE after 3 months, and not once every 3 months, then you would need to change the TotalBillingCycles to 1. That way it would bill just one time after 3 times (depending on the start date you set for the profile).

Same goes for the the others. What you're showing would do once per month, once every 3 months, once every 6 months, and then once per year.

他のヒント

Yes, the answer of Drew Angell is correct. This page clarifies the point –
https://developer.paypal.com/docs/archive/express-checkout/integration-guide/ECRecurringPayments/#recurring-payments-terms


Billing cycle
Make one payment per billing cycle. Each billing cycle has two components:

  • The billing period specifies the unit to calculate the billing cycle (such as days or months).
  • The billing frequency specifies the number of billing periods that make up the billing cycle.

For example, if the billing period is Month and the billing frequency is 2, the billing cycle is 2 months. If the billing period is Week and the billing frequency is 6, PayPal schedules the payments every 6 weeks.


ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top