Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mobile_b2b(self, product_name, business, callback=None):
providers = PaymentService.PROVIDER.values()
types = PaymentService.TRANSFER_TYPE.values()
schema = Schema({
'provider': And(str, lambda s: s in providers),
'transferType': And(str, lambda s: s in types),
'currencyCode': And(str, lambda s: len(s) == 3),
'amount': And(lambda f: float(f) > 0),
'destinationChannel': And(str, len),
'destinationAccount': And(str, len),
Optional('metadata'): And(dict)
})
business = schema.validate(business)
url = self._make_url('/mobile/b2b/request')
headers = dict(self._headers)
headers['Content-Type'] = 'application/json'
data = business.copy()
data.update({