Last active
April 2, 2019 08:39
-
-
Save wehub/b72fb0323c22ea7f1b5f15b5bfe90f3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WePay Python SDK - http://git.io/v7Y1jA | |
| from wepay import WePay | |
| # application settings | |
| account_id = 123456789 # your app's account_id | |
| access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20' # your app's access_token | |
| production = False | |
| # set production to True for live environments | |
| wepay = WePay(production, access_token) | |
| # create the checkout | |
| response = wepay.call('/checkout/create', { | |
| 'account_id': account_id, | |
| 'amount': '24.95', | |
| 'short_description': 'A brand new soccer ball', | |
| 'type': 'goods', | |
| 'currency': 'USD', | |
| 'hosted_checkout': { | |
| 'require_shipping': True, | |
| 'shipping_fee': '1.00', | |
| 'redirect_uri': 'http://www.example.com/payment_success' | |
| }, | |
| 'fee': { | |
| 'app_fee': '0.15', | |
| 'fee_payer': 'payee' | |
| }, | |
| 'email_message': { | |
| 'to_payer': 'Items<BR>Ron Santo 1969 - $20.00<BR>Ernie Banks 1970 - $30.00<br>Tax - $2.50<br>Total: $50.00', | |
| 'to_payee': 'Items<BR>Ron Santo 1969 - $20.00<BR>Ernie Banks 1970 - $30.00<br>Tax - $2.50<br>Total: $50.00' | |
| } | |
| }) | |
| # display the response | |
| print response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment