For this exercise you'll be implementing a Processor connection using PayPal's REST API and also tackling some of the client side implementation on the web.
You'll need to log in to PayPal's developer site and create a sandbox account. Once you've done that, you should be able to find an Application with a client ID and client Secret.
For the client side log in, you'll need to create a sandbox test user as well. You can find them in the Sandbox > Accounts section of the dashboard.
There are 4 parts to the exercise:
Backend:
- Add your sandbox credentials to
PayPal.ts
- Implement the
authorize()
method inPayPal.ts
- Implement the
cancel()
method inPayPal.ts
Client Side:
- Complete the implementation of
renderPayPalButton()
inclient.js
Feel free to tackle these in the order that makes most sense to you.
- In the backend we've provided a
HTTPClient
implementation which you can use to make API calls to PayPal's orders API - Check out PayPal's orders API and client SDK documentation
- Once a transaction has been authorized, you should be able to cancel it using the 'Cancel Transaction' button.
- Don't forget to log in to PayPal using the test account which you created!
- If anything is unclear, Don't hesitate to reach out
To run the program use the following command:
yarn start:payment-methods
and your browser should open at http://localhost:4444
Happy Coding :D