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/8e9ec26cdc7a7a58945e7e10b89c26ec to your computer and use it in GitHub Desktop.

Select an option

Save wehub/8e9ec26cdc7a7a58945e7e10b89c26ec 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
access_token = 'STAGE_8a19aff55b85a436dad5cd1386db1999437facb5914b494f4da5f206a56a5d20'
production = False
# credit card id to charge
credit_card_id = 123456789
# set production to True for live environments
wepay = WePay(production, access_token)
# charge the credit card
response = wepay.call('/checkout/create', {
'account_id': account_id,
'amount': '25.50',
'short_description': 'A brand new soccer ball',
'type': 'goods',
'currency': 'USD',
'payment_method': {
'type': 'credit_card',
'credit_card': {
'id': credit_card_id
}
}
})
# display the response
print response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment