node.js - Paypal Node js集成定制
问题描述
我一直在使用 node js 作为后端,并使用 Paypal 作为支付网关。一切正常。我正在使用示例支付数据,即
const create_payment_json = {
"intent": "authorize",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"return_url": "http://localhost:3000/success",
"cancel_url": "http://localhost:3000/cancel"
},
"transactions": [{
"item_list": {
"items": [{
"name": "Red Sox Hat",
"sku": "001",
"price": "25.00",
"currency": "USD",
"quantity": 1
}]
},
"amount": {
"currency": "USD",
"total": "25.00"
},
"description": "Hat for the best team ever"
}]
};
你看,在交易的密钥中有一个名为 item_list 的密钥,我不想在我的 JSON 中传递这个,只要金额数据就足够了。
上面的图片是带有item_list的,你可以看到用红色圈出的总量。但是当我只通过金额字段而不是 item_list_field 时,我没有得到这个金额。有没有办法在不通过 this 的情况下显示这个 Total amount item_list
。它可以正常工作,item_list
但不会向用户显示总量,这可能会使用户感到困惑。有没有针对这个问题的解决方案或建议。
提前致谢
解决方案
推荐阅读
- javascript - 如何只禁用一个编辑按钮
- ios - 基于字符串的动态UILabel
- docker - Docker 运行 ENTRYPOINT 不替换环境变量
- html - 将 2 个输入文本框并排放置
- drupal-7 - flex-slider 第一张幻灯片在移动设备上的高度错误
- rust - 为什么这个 Rust 二叉树在测试中会溢出它的堆栈?
- c - 使用 PrintWindow 渲染 chrome
- vb.net - 将 TableView.Select 与路径字符串一起使用
- websocket - WebSocket:失败:WebSocket 握手期间出错:net::ERR_INVALID_HTTP_RESPONSE
- node.js - React Native 使用 fetch 向 Node.js 服务器发送数据