3

I have a PayPal subscription set up on a Wordpress site. After the payment, the user is redirected back to domain.com/?token=ABCDABCDABCD

Can I use the token parameter in the URL to get the order/transaction info from the PayPal API? The documentation doesn't seem to help.

The only token that I can find in the docs is the authentication token, so I'm not sure what this one is supposed to be. I was under the impression that the return URL should have the subscription ID, but that looks like I-ABCDEFGH and it's not there even though the subscription is created successfully on PayPal.

sveti petar
  • 3,637
  • 13
  • 67
  • 144
  • No, you also need Client_id and Secret or of course a valid auth token – Bad Pussycat Feb 03 '21 at 13:50
  • @BadPussycat I have the client_id and secret. It's my own account. But I can't find how I can use the token to fetch the payment/subscription details. – sveti petar Feb 03 '21 at 14:00
  • Never worked with Subscriptions myself but according to the docu you need this request `curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-BW452GLLEP1G \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"` (of course not the sandbox url) https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get – Bad Pussycat Feb 03 '21 at 14:50
  • does this help? Or you need more detailed answer? – Bad Pussycat Feb 03 '21 at 14:52
  • @BadPussycat That request uses the subscription ID. This is a different thing from the token. It always begins with "I-" while the token is just a random string. – sveti petar Feb 03 '21 at 14:54
  • ok sorry then I have no idea. I think you should look in the logs to find out what token this is. (maybe you find out what subscription id is assigned to that token) – Bad Pussycat Feb 03 '21 at 15:10
  • I guess this is the payment_id – Bad Pussycat Feb 03 '21 at 15:17
  • So maybe you it's worth tying the payment api. maybe in the response is a hint to what subcription the payment belongs. Just a wild guess ;-) – Bad Pussycat Feb 03 '21 at 15:22
  • Look here, I think is the parameter for this API https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#payouts-get-response. If you check the response, you should receive the entire list of items – Marco Massetti Feb 07 '21 at 18:57
  • @MarcoMassetti Those are payouts... – sveti petar Feb 09 '21 at 08:06

0 Answers0