Exemplo n.º 1
0
    def subscribe(self, client_id, access_token=None):
        requestor = api_requestor.APIRequestor(access_token)
        url = '/v1/plans/subscribe/'
        params = {'customer_key': client_id, 'plan_key': self.key}
        headers = None
        response, access_token = requestor.request('post', url, params, headers)

        return util.convert_to_gpayments_object(response, access_token)
Exemplo n.º 2
0
 def list(cls, access_token=None, **params):
     requestor = api_requestor.APIRequestor(access_token,
                                            api_base=cls.api_base())
     url = cls.class_logs_url()
     response, access_token = requestor.request('get', url, params)
     gpayments_object = util.convert_to_gpayments_object(
         response, access_token)
     return gpayments_object
    def create(cls, access_token=None, **params):
        requestor = api_requestor.APIRequestor(access_token)
        url = cls.class_url()
        headers = None
        response, access_token = requestor.request('post', url, params,
                                                   headers)

        return util.convert_to_gpayments_object(response, access_token)
 def nested_resource_request(cls, method, url, api_key=None, **params):
     requestor = api_requestor.APIRequestor(api_key)
     headers = None
     response, api_key = requestor.request(method, url, params, headers)
     return util.convert_to_gpayments_object(response, api_key)