问题:我正在试图弄清楚如何检查邮政编码(在paypal智能按钮结帐期间输入)是否满足特定要求。我有createOrder和onApprove对象属性,我想在捕获付款之前检查邮政编码,这样我就可以拒绝付款,并取消订单。 paypal.Buttons(
{
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
我正在尝试使用react库(@ PayPal /react-paypal-js)与paypal结账集成,付款的响应是成功的,但当我使用实时客户端id时,它不会从我的信用卡中计费。 import { api } from "../services/api";
import { PayPalButtons, PayPalScriptProvider } from "@paypal/react-paypal-js";
export default function Pagamento() {
function createOrder(data, actio
我试图发送一个订单确认电子邮件时,PayPal付款处理是批准的。我相信问题在于,当我提交我的表单时,页面会刷新,当PayPal付款被批准时,它也会刷新页面。PHP代码可以很好地满足我目前的需要,PayPal智能按钮也是如此,主要的问题是它们只能单独工作,我需要两者都执行。我已经找了很长一段时间了,还没能找到解决这个问题的具体方法,但也许我还没见过他们。
我想使用AJAX提交表单,而不需要刷新,但我承认我对这类东西非常陌生,而我添加的代码似乎没有多大区别。
onApprove: function (data, actions) {
// Get the order details
这可能非常简单,但是如何向PayPal按钮组件发送信息呢?例如,产品的名称,总价值?
这是我所做的,我测试了我的代码,我得到了一个“事务成功”:
// In panierPage, where the user can click on the PayPal button
import PayPal from '../services/PayPal/paypal'
return (
<Grid style={{marginLeft: '2%'}}>
<PayP
因此,我正在建立一个姜戈电子商务,允许通过PayPal支付。一旦用户介绍了他所有的PayPal信息并按下了pay,PayPal窗口就会消失,并且需要几秒钟的时间来调用我放在onApprove中的函数。正如我在这里所展示的: // Finalize the transaction
onApprove: function (data, actions) {
return actions.order.capture().then(function (details) {
submitFormData(); //redirects to the
我想设置一个PayPal结账.在开发env中,它可以工作,但是当我试图将我的代码部署到vercel时,我一直收到以下错误:
Error: usePayPalScriptReducer must be used within a PayPalScriptProvider
知道为什么吗?我在使用服务器端的道具和服务器端的路径,它是否有某种联系?
Vercel还生成一个日志,说明它可能与有关。
下面是我的PayPal组件:
import { PayPalScriptProvider, PayPalButtons } from '@paypal/react-paypal-js'
imp