JI-Web
JI-Web

Reputation: 543

paypal reference transactions billing agreement

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:

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.

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)

Upvotes: 0

Views: 1090

Answers (1)

habdulkarim
habdulkarim

Reputation: 176

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.

Upvotes: 0

Related Questions