I am doing stripe payment integration using python and use the following data:
import requests
import json
pos = requests.post
url = "https://api.stripe.com/v1/sources"
headers = {'AUTHORIZATION': 'Bearer sk_test_NXht3wZpuYWRIWpMDDqT3RG2'}
data = {
'type': 'alipay',
'owner[email]': 'abc@xyz.com',
'redirect[return_url]': 'https://www.google.com',
'amount': '500',
'currency': 'USD',
'metadata': {
'data': 'data'
}
}
pos(url, data=data, headers=headers).text
json.loads(pos(url, data=data, headers=headers).text)
When give the metadata it gives error '{\n "error": {\n "message": "Invalid hash",\n "param": "metadata",\n "type": "invalid_request_error"\n }\n}\n' but according to stripe documentation metadata can be used( https://stripe.com/docs/api/curl#create_source-metadata)
Can anyone tell the solution why it gives that error.