PayPal 在沙盒模式下发回 400 响应代码 PAYEE_ACCOUNT_INVALID 的原因是什么?

问题描述 投票:0回答:1

我正在尝试使用

paypal
nodejs
实施付款。到目前为止,我正在使用
paypal-rest-sdk
来处理 API 调用。我编写了一个代码,我获取信用卡信息,然后将它们转移到
paypal
,但我得到一个代号为
400 Response Code
PAYEE_ACCOUNT_INVALID
。似乎有很多这样的问题,但没有一个人正确地解决了解决方案。

这个案例的原因是什么?这是我要发出的

json

// Construct a PayPal payment request
  const createPaymentJson = {
    intent: 'sale',
    payer: {

      payment_method: 'credit_card',

      funding_instruments: [
        {
          credit_card: {
            number: numericCardNumber, // Use the numeric card number without spaces
            type: "mastercard", // Card type (e.g., visa, mastercard), paymentData.cardType
            expire_month: paymentData.expiry.split(' / ')[0],
            expire_year: '20' + paymentData.expiry.split(' / ')[1], // Properly format the year
            cvv2: paymentData.cvv, // CVV code
          },
        },
      ],
    },

    
    
    transactions: [
      {
        amount: {
          total: paymentData.amount, // Extract the amount from the request body
          currency: paymentData.currency, // Extract the currency from the request body
        },
        description: paymentData.description, // Extract the description from the request body
      },
    ],

    redirect_urls: {
      return_url: process.env.PAYPAL_RETURN_URL,
      cancel_url: process.env.PAYPAL_CANCEL_URL,
    },

  };
node.js paypal paypal-rest-sdk
1个回答
0
投票

paypal-rest-sdk 和 v1/ payment API 均已弃用,不应用于任何新的集成。

要通过 PayPal 接受银行卡,请使用标准高级集成,无需用于 HTTPS API 调用的 SDK,因为不支持任何 SDK。

© www.soinside.com 2019 - 2024. All rights reserved.