How to make a charge with paypal API v2 without using the smart buttons?

flipjms
New Community Member

I'm updating my paypal code on a website since paypal API v1 has been deprecated but I can't seem to find anywhere in the docs how to do it. The flow is quite simple: user selects paypal as the payment service and hits next, I redirect the user to paypal to insert the payment details, paypal redirects back so I can process the order accordingly.

The API V2 seems to focus on the smart buttons but that doesn't fit on the current UX I have. Looking through the docs I can't find the necessary endpoint to achieve that. Currently, with the V1 I have a web profile and I just call /v1/payments/payment with all the order information and callback URL and that's it.

On V2, I haven't found any endpoint that accepts a callback URL, for example. My first attempt was to create an order by calling /v2/checkout/orders, which does create the order and gives me back the HATEOAS links so I can redirect the user to paypal to enter the payment details but I haven't set anywhere the callback URL. So, where does it go after the user pays the order? I couldn't test it because when I use the sandbox to try to pay for it, it gives some generic error.

What am I missing?

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.