Search code examples
javascriptrestpaypalpayment

Is it possible and allowed to use custom (own) PayPal button with Express Checkout and REST API?


I have implemented PayPal rest integration, and now I can create payments. So I have to enable payments approval now. I used this documentation:

https://developer.paypal.com/docs/integration/web/accept-paypal-payment/

As I can see, usage of approval_url i a legacy method (it opens approval page in a separate tab). But a modern one, described here:

https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/advanced-integration/#set-up-your-client

does require to render PayPal button using checkout.js library script. I want to use my own button, but don't know what to call to perform payment approval. And I don's know if it is allowed at all. Can not find the good answer anywhere. Please help.


Solution

  • No, not easily it isn't The customization link provided above is a poor imitation of customization. Customization to most dev's is likely to mean the ability to choose any button you want and to interact using the API programmatically. The poor API provided by paypal currently only allows choosing the color/size of their buttons. It also forces you to use their checkout.js on load so that they can track your users. I would avoid it if possible.

    Basically your choices now are:

    1. Use express checkout with the checkout.js they provide and submit to paypals tracking/limited customization. In paypal marketing speak, engage in the optimized loading button with fully cohesive paypal branding.

    2. Use basic checkout, that requires a redirect back and forth. Old school tech still working.

    3. Try to workaround the limited checkout.js and find the secret API behind it to create your customized button.

    I went for option 2.