【发布时间】:2021-01-14 05:45:16
【问题描述】:
我正在尝试将 PayPal 与我的服务器集成。这是我正在关注的指南: https://developer.paypal.com/docs/checkout/reference/server-integration/set-up-transaction/#on-the-server
它说使用以下代码对服务器进行 API 调用:
createOrder: function() {
return fetch('/my-server/create-paypal-transaction', {
method: 'post',
headers: {
'content-type': 'application/json'
}
}).then(function(res) {
return res.json();
}).then(function(data) {
return data.orderID; // Use the same key name for order ID on the client and server
});
}
这是他们提供的示例,但我看不到任何方法可以对这些方法进行 API 调用。它应该如何工作?
https://github.com/paypal/Checkout-NET-SDK/tree/develop/Samples
我的网站是 Web 表单,我是否需要创建一个单独的 Web API 才能使用此 Paypal 代码,或者我能否在我的网站项目中包含一个 API 端点?
【问题讨论】:
标签: javascript asp.net paypal webforms