Cookie Eater Asked:2022-07-30 18:30:30 +0800 CST2022-07-30 18:30:30 +0800 CST 2022-07-30 18:30:30 +0800 CST 使用 revolut bank api 处理付款 772 我需要一个使用 Python 支付商品的链接,我有一家 revolut 银行,所以我用谷歌搜索了这家银行的 api。不幸的是,我并没有完全弄清楚如何做到这一点,我只是意识到我需要发出一个带有数据的请求并获取其他数据作为输出。 python python-3.x 1 个回答 Voted Best Answer Сергей Ш 2022-07-30T18:56:44+08:002022-07-30T18:56:44+08:00 使用https://curlconverter.com/ import requests headers = { 'Authorization': 'Bearer [yourApiKey]', 'Content-Type': 'application/json; charset=utf-8', } json_data = { 'amount': 100, 'currency': 'GBP', } response = requests.post('https://merchant.revolut.com/api/1.0/orders', headers=headers, json=json_data) # Note: json_data will not be serialized by requests # exactly as it was in the original request. #data = '{\n "amount": 100,\n "currency": "GBP"\n }' #response = requests.post('https://merchant.revolut.com/api/1.0/orders', headers=headers, data=data)
使用https://curlconverter.com/