简体   繁体   中英

PayPal Reference Transaction by Billing Agreement ID

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM