Search code examples
phppaypalpaypal-sandboxexpress-checkout

Paypal Express Checkout: How do I create a recurring profile?


I am using PayPal express checkout.and my billing cycle run in 6 month.

Below Flow used.

  1. SetExpressCheckout
  2. GetExpressCheckoutDetails
  3. DoExpressCheckoutPayment
  4. CreateRecurringPaymentsProfile

Above 3 flow working perfectly. But my question about last flow. I can CreateRecurringPaymentsProfile using hosted page or because in API pass card detail this detail mandatory. Without card detail I can create recurring profile? Or other way to create recurring profile without card detail?

Other question is CreateRecurringPaymentsProfile cycle run once in 6 month that option not available in PayPal.


Solution

  • Per the documentation at https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECRecurringPayments/ :

    In order to use CreateRecurringPaymentsProfile you must first already have a billing agreement set up. The billing agreement contains the card information. Create the billing agreement with SetExpressCheckout with parameters/values such as these:

    USER:krondoian_api1.gmail.com
    PWD:B999999999999
    SIGNATURE:A9999999999999999
    METHOD:SetExpressCheckout
    VERSION:86
    PAYMENTREQUEST_0_AMT:1.23
    PAYMENTREQUEST_0_CURRENCYCODE:USD
    PAYMENTREQUEST_0_PAYMENTACTION:AUTHORIZATION
    cancelUrl:https://example.com/cancel
    returnUrl:https://example.com/success
    L_BILLINGTYPE0:MerchantInitiatedBilling
    L_BILLINGAGREEMENTDESCRIPTION0:ClubUsage
    cancelUrl:https://example.com/cancel
    returnUrl:https://example.com/success
    

    In response to your other question about having a recurring payment process every 6 months, it is possible to do that. In the CreateRecurringPaymentsProfile call, set the following parameters and values:

    BILLINGPERIOD:month
    BILLINGFREQUENCY:6