Skip to content

Instantly share code, notes, and snippets.

@wehub
Last active June 19, 2017 22:03
Show Gist options
  • Select an option

  • Save wehub/3d08b04e282c94a3d36b2070aa73e0b3 to your computer and use it in GitHub Desktop.

Select an option

Save wehub/3d08b04e282c94a3d36b2070aa73e0b3 to your computer and use it in GitHub Desktop.
# WePay Python SDK - http://git.io/v7Y1jA
from wepay import WePay
# application settings
account_id = 123456789 # the merchant's account_id
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20' # the merchant's access_token
preapproval_id = '12345' # the preapproval_id from step 1
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': '19.99',
'short_description': 'Payment for test project',
'type': 'goods',
'currency': 'USD',
'payment_method': {
'type': 'preapproval',
'preapproval': {
'id': preapproval_id
}
}
})
# display the response
print response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment