Website.checkout_using_paypal#
- Website.checkout_using_paypal(client_id, client_secret, sandbox=True, **kwargs)#
Checkout using PayPal API.
1. You need to first get the client ID and the client secret for your PayPal account. See the following link for more information: https://developer.paypal.com/api/rest/.
2. Read the following link to learn about the key word arguments that you need to pass to this function: https://developer.paypal.com/docs/api/orders/v2/#orders_create (only the parameters under the REQUEST BODY section).
3. Call this function and pass the client ID and the client secret as the first two arguments. Then pass the keyword arguments that you learned about in step 2.
4. The function will return a dictionary. You might need to store some of the data in this dictionary for later use. See the Responses section in the following link for more information: https://developer.paypal.com/docs/api/orders/v2/#:~:text=payment%20with%20PayPal.-,Responses,-200A%20successful.
- Parameters:
client_id (str) – The client ID of your PayPal account.
client_secret (str) – The client secret of your PayPal account.
sandbox (bool, default=True) – If
True, the sandbox version of PayPal will be used. Otherwise, the live version will be used.kwargs – Keyword arguments that can be passed to Create order request under the REQUEST BODY section.
- Returns:
The response of the PayPal API. You might need to store some of the data in this dictionary for later use. See the Responses section in the following link for more information: Create order request.
- Return type:
dict