0

在此处输入图像描述我正在为我的一位客户集成 PayPal 支付。他已经从他们那里启用了支付功能。当我通过代码运行交易时,我得到了所需的响应,但不知何故,当我登录到 PayPal 沙盒帐户时,我无法看到交易。我还指定了收件人的电子邮件地址,所以我相信我也应该收到付款的电子邮件。所以问题是:

  • 无法在仪表板中看到付款
  • 由于我在创建付款项目时指定了电子邮件地址,因此没有收到任何电子邮件

这是我为处理付款而编写的代码

            Payout payout = new Payout
            {
                sender_batch_header = new PayoutSenderBatchHeader()
                {
                    email_subject = "You recieved a payout!!",
                    recipient_type = PayoutRecipientType.EMAIL,
                    sender_batch_id = "batch_" + Guid.NewGuid().ToString().Substring(0, 8),
                }
            };

            payout.items = new List<PayoutItem>();

            payout.items.Add(new PayoutItem()
            {
                recipient_type = PayoutRecipientType.EMAIL,
                amount = new Currency()
                {
                    currency = "USD",
                    value = amountToBePaid.ToString(),
                },
                note = "Please check your email for details.",
                sender_item_id = "item_" + Guid.NewGuid().ToString().Substring(0, 4),
                receiver = "XXXXXXXXXX@gmail.com",
            });

            payout.items.Add(new PayoutItem()
            {
                recipient_type = PayoutRecipientType.EMAIL,
                amount = new Currency()
                {
                    currency = "USD",
                    value = amountToBePaid.ToString(),
                },
                note = "Please check your email for details.",
                sender_item_id = "item_" + Guid.NewGuid().ToString().Substring(0, 4),
                receiver = "XXXXXXXXXX@gmail.com",
            });

            var createdPayout = payout.Create(token, false);

            var payoutBatch = Payout.Get(token, createdPayout.batch_header.payout_batch_id);

            string status = payoutBatch.batch_header.batch_status;
            string payoutItemId = payoutBatch.items[0].payout_item_id;
            string payoutBatchId = payoutBatch.batch_header.payout_batch_id;

谁能告诉我我错过了什么?任何指针将不胜感激


使用请求的日志进行更新。API 请求:

{
  "batch_header": {
    "payout_batch_id": "XXX",
    "batch_status": "PENDING",
    "time_created": "2022-02-23T07:01:04Z",
    "sender_batch_header": {
      "sender_batch_id": "batch_9f63cf9a",
      "email_subject": "You recieved a payout!!",
      "recipient_type": "EMAIL"
    },
    "amount": {
      "currency": "USD",
      "value": "50.00"
    },
    "fees": {
      "currency": "USD",
      "value": "1.00"
    }
  },
  "items": [
    {
      "payout_item_id": "XXX",
      "transaction_status": "PENDING",
      "payout_item_fee": {
        "currency": "USD",
        "value": "1.00"
      },
      "payout_batch_id": "XXX",
      "payout_item": {
        "recipient_type": "EMAIL",
        "amount": {
          "currency": "USD",
          "value": "50.00"
        },
        "note": "Please check your email for details.",
        "receiver": "channa.development@gmail.com",
        "sender_item_id": "item_a42a"
      },
      "links": [
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/payouts-item/XXX",
          "rel": "item",
          "method": "GET",
          "enctype": "application/json"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/pa youts/XXX?page_size=1000&page=1",
      "rel": "self",
      "method": "GET",
      "enctype": "application/json"
    }
  ]
}

回复:

{
  "batch_header": {
    "payout_batch_id": "XXX",
    "batch_status": "PENDING",
    "sender_batch_header": {
      "sender_batch_id": "batch_9f63cf9a",
      "email_subject": "You recieved a payout!!",
      "recipient_type": "EMAIL"
    }
  },
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payouts/XXX",
      "rel": "self",
      "method": "GET",
      "enctype": "application/json"
    }
  ]
}
4

1 回答 1

0
      "transaction_status": "PENDING",

如果具有指定电子邮件地址的沙盒帐户不存在(或未确认其地址),则交易将处于待处理状态。这是正常行为。

对于实时支付,没有 PayPal 账户的收款人会收到一封电子邮件,告知他们有钱在等,并附有创建账户(或登录并将此电子邮件添加到现有账户)的说明,从而申请交易。

对于沙盒,无法查看此类“电子邮件”通知——开发者仪表板中的“通知”选项卡仅适用于发送到与您的 developer.paypal.com 登录相关联的现有帐户的通知;任何帐户都不存在的电子邮件不会与您的开发人员登录相关联,因此无法出现在此通知选项卡中。不过,如果您只是使用该电子邮件创建一个沙盒帐户,您就可以要求付款。


无论如何,收款人始终有 30 天的时间来要求待付款 - 否则它将被自动取消并退还资金。

于 2022-02-23T07:54:51.187 回答