From 1b1a614ffdcb73ba0b541abeaf294b6a72478f90 Mon Sep 17 00:00:00 2001 From: joamag Date: Mon, 30 May 2016 11:38:08 +0100 Subject: [PATCH] new auth callback support --- src/paypal/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/paypal/base.py b/src/paypal/base.py index c30bc84..cee27a5 100644 --- a/src/paypal/base.py +++ b/src/paypal/base.py @@ -74,6 +74,10 @@ def __init__(self, *args, **kwargs): self.client_secret = kwargs.get("client_secret", self.client_secret) self.access_token = kwargs.get("access_token", None) + def auth_callback(self, params, headers): + self.oauth_token() + headers["Authorization"] = "Bearer %s" % self.get_access_token() + def oauth_token(self, grant_type = "client_credentials"): url = self.base_url + "oauth2/token" token = appier.http._authorization(self.client_id, self.client_secret)