Created
January 23, 2015 15:04
-
-
Save chris-jamieson/c81443fcfbe19ea34630 to your computer and use it in GitHub Desktop.
GoCardless Incorrect token error
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
| import gocardless | |
| from api import settings | |
| # set environment to sandbox | |
| gocardless.environment = settings.GOCARDLESS_ENVIRONMENT | |
| gocardless.set_details( | |
| app_id=settings.GOCARDLESS_MERCHANT_APP_ID, | |
| app_secret=settings.GOCARDLESS_MERCHANT_APP_SECRET, | |
| access_token=settings.GOCARDLESS_MERCHANT_ACCESS_TOKEN, | |
| merchant_id=settings.GOCARDLESS_MERCHANT_ID | |
| ) | |
| def get_gc_partner_authorization_url(merchant_details): | |
| """ | |
| passes merchant details to GoCardless and returns a URL, where a merchant can authorise with GoCardless | |
| info: https://developer.gocardless.com/python/#merchant-account-authorization | |
| """ | |
| client = gocardless.Client( | |
| settings.GOCARDLESS_PARTNER_APP_ID, | |
| settings.GOCARDLESS_PARTNER_APP_SECRET | |
| ) | |
| url = client.new_merchant_url( | |
| redirect_uri='http://httpbin.org/get', | |
| merchant=merchant_details | |
| ) | |
| return url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment