python - 如何使用贝宝修复删除深度复制错误?Python
问题描述
body = {
"sender_batch_header": {
"recipient_type": "EMAIL",
"email_message": "SDK payouts test txn",
"note": "Enjoy your Payout!!",
"sender_batch_id": "Test_SDK_1",
"email_subject": "This is a test transaction from SDK"
},
"items": [{
"note": "Your " + str(form.nbr_athena.data) + "€ Payout!",
"amount": {
"currency": "EUR",
"value": str(form.nbr_athena.data)
},
"receiver": str(form.email_paypal.data),
"sender_item_id": "Test_txn_5"
}]
}
request_paypal = PayoutsPostRequest()
request_paypal.request_body(body)
# Call API with your client and get a response for your call
response = sdk_paypal_client.execute(request)
# If call returns body in response, you can get the deserialized version from the result attribute of the response
batch_id = response.result.batch_header.payout_batch_id
print(batch_id)
print(response)
flash("votre monnaie à bien était envoyé !!", "success")
payment.status = Status.Success.value
db.session.add(payment)
db.session.commit()
我试图在我的网站上集成 paypal sdk,但是当使用此行发送请求时,response = sdk_paypal_client.execute (request)
我收到一个深拷贝错误
TypeError: cannot serialize '_io.BufferedReader' object
我尝试对我的请求进行字符串化,但这并不好
解决方案
推荐阅读
- r - (已关闭)R 闪亮应用程序中的覆盖小部件
- php - PHP DOMDocument saveHTML 添加字符
- flutter - 颤振情绪识别器api?
- c# - 将对象参数从一个类传递到另一个类
- c++ - 从 diskpart 读取输出
- python - PyQt5。如何在与 ContextMenu 连接的 QTextEdit 中获取光标位置?
- angularjs - 无法在angularjs中显示json数据
- javascript - expressJS 上的异步函数
- .htaccess - 从站点上的特定文件夹中删除 HTTPS
- java - 没有嵌套评估时,Eclipse“无法执行嵌套评估”错误