0
votes

I'm trying to create a PHP script where I can execute a reference transaction. I got in my database this billing-agreement-ids like on this page: https://developer.paypal.com/docs/classic/express-checkout/ht_ec-refTrans-SetEC-DoRefTrans-curl-etc/ (B-7FB31251F28061234).

What should my PHP script look like to do step 4? I created a Classic API App, but I'm not sure about my configuration.

I downloaded:

  • github.com/paypal/sdk-core-php
  • github.com/paypal/codesamples-php
  • github.com/paypal/rest-api-sample-app-php/

I guess I should do something with classic api because ids like B-7FB31251F28061234 don't exist in REST api.

1

1 Answers

0
votes

What you're looking is the DoReferenceTransaction API. You'll simply pass in the Billing Agreement ID along with the amount you wish to charge.

If you're already comfortable with those other SDK's you should be able to handle that call without any issue. I will say, though, that you'll probably like this SDK better. It's a lot easier to use than PayPal's, and even their own integration technicians prefer and recommend that one.