0
votes

We require reference transactions via PayPal to bill customers monthly with varying amounts. e.g. first month is $30, second month may be $35, third month may be $25 etc

So far this seems to be the best approach: https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/

I am using the PayPal recommended SDK from this page: https://developer.paypal.com/docs/classic/api/nvpsoap-sdks/ and using the ExpressCheckout Method. (paypal/merchant-sdk-php installed via composer)

We have a free PayPal business account.

Testing via Sandbox I am able to:

  1. Get a token (SetExpressCheckout) - category->Digital, billingAgreement, Type=Sale
  2. forward customer to sandbox paypal login
  3. Confirm the payment
  4. redirect back to our system (returnUrl)
  5. Process the payment (GetExpressTocket + doExpressCheckout)

Questions:

  • Does the PayPal business account require any switch/status/upgrade to enable Reference transactions on the live environment?

  • How do you setup a $0 billing agreement to invoice an amount later in the month? When passing a 0 amount in step 1 above and error is displayed

Item name, amount and quantity are required if item category is provided, ErrorCode 10003

This contradicts to documentation https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/#setting-up-a-billing-agreement-before-payment which states to set the amount to 0...? UPDATE: Removing the setting $itemDetails->ItemCategory = 'Digital'; solved the $0 amount issue.

  • Billing ID is not returned even though I've passed the BillingAgreement data

    // Billing agreement details $billingAgreementDetails = new BillingAgreementDetailsType('MerchantInitiatedBillingSingleAgreement'); $billingAgreementDetails->BillingAgreementDescription = $billingAgreementTxt; $setECReqDetails->BillingAgreementDetails = array($billingAgreementDetails);

I know there are a few questions within the post but I believe they are all related to the scope of 'Reference Transactions' within PayPal. I'm looking for recommendations on approach and explanations to the contradictions in documentation. (or if I'm doing something wrong then happy to hear it)

1
After speaking with Paypal support.. they said that the Sandbox is buggy and Reference Transactions don't work on the Sandbox... Not sure what to think and will keep trying on a live account. - JI-Web

1 Answers

0
votes

To answer your question:

1) Does the PayPal business account require any switch/status/upgrade to enable Reference transactions on the live environment?

If you are receive an error when calling for Reference Transaction, probably that the setting is turned off in your account. You will need to contact PayPal Business Support team to enable it.

2) Billing ID is not returned.

To setup billing agreement, you will need to pass paymentaction=authorization in SetExpressCheckout request. You will not be able to setup billing agreement if you set the paymentaction as sale.