Example #1
0
 def params(self, value):
     if value is None:
         self._params = None
         return
     params = Params(public_key=self.public_key, sandbox=self.sandbox, **value)
     params.require_fields(self.REQUIRED_FIELDS)
     self._params = params
Example #2
0
 def _get_request_data(self, params):
     params = Params(public_key=self.public_key, **params)
     params.require_fields(self.REQUIRED_FIELDS)
     return generate_request_data(self.private_key, params)
Example #3
0
def encode_data(params):
    if not isinstance(params, Params):
        params = Params(params)
    return base64.b64encode(params.to_json().encode('utf-8')).decode()