【问题标题】:Paypal expres checkout is not sending back the posted dataPaypal 快速结帐未发回已发布的数据
【发布时间】:2021-05-09 18:41:07
【问题描述】:

在我的 laravel 应用程序中,我将数据发送给邮递员,如下所示:

array:8 [▼
  "items" => array:1 [▼
    0 => array:4 [▼
      "name" => "PWN Netherlands: Building a D&I foundation through mentoring, coaching & sponsorship"
      "price" => 122222
      "qty" => 1
      "event_id" => 1
    ]
  ]
  "return_url" => "http://localhost:8000/paypal/ec-checkout-success"
  "invoice_id" => "_6"
  "item_number" => 22
  "custom" => 33
  "invoice_description" => "PWN Netherlands: Building a D&I foundation through mentoring, coaching & sponsorship"
  "cancel_url" => "http://localhost:8000"
  "total" => 122222
]

所以我发送item_numbercustom 字段但付款后我得到它只是tokenplayerId 如下所示:

array:2 [▼
  "token" => "EC-4DA935906T0704531"
  "PayerID" => "QQN222QZK25CA"
]

【问题讨论】:

    标签: php laravel paypal


    【解决方案1】:

    在重定向到 PayPal 并获得付款人批准后,这就是您将在返回 URL 的参数中返回的所有内容。

    如果您已集成旧的经典 NVP API,则获取详细信息(如果您没有将它们存储在服务器会话中)的调用是 GetExpressCheckoutDetails。

    此外,在您执行之前不会付款。这样做的调用是 DoExpressCheckoutPayment。


    这是一个您似乎正在集成的非常旧的 API,因此建议切换到最新的 API,例如 documented here 的“创建订单”和“捕获订单”。这些应该是您服务器上返回 JSON 的两条路由,然后您可以将其与以下批准流程配对:https://developer.paypal.com/demo/checkout/#/pattern/server

    【讨论】:

    • 嗨,我正在使用这个包与 laravel github.com/srmklive/laravel-paypal 进行整合
    • 我怎么能理解它是一种新的整合方式还是旧的方式
    • 查看 API 调用并阅读他们的文档。正如我所说,您使用的似乎很旧。
    猜你喜欢
    • 2014-04-04
    • 2014-12-07
    • 2013-03-05
    • 2017-11-22
    • 2011-08-10
    • 2011-06-16
    • 2016-07-10
    • 2017-07-15
    • 2012-10-08
    相关资源
    最近更新 更多