【问题标题】:How to transform PayPal Classic Payment form into PayPal REST API PHP Application?如何将 PayPal Classic Payment 表单转换为 PayPal REST API PHP 应用程序?
【发布时间】:2013-10-11 20:24:40
【问题描述】:

以下是最简单的PayPal界面形式:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" /> 
  <input type="hidden" name="cmd" value="_xclick" /> 
  <input type="hidden" name="business" value="JohnDoe2@example.com" /> 
  <input type="hidden" name="item_name" value="Purchase at the Virtual Store" /> 
  <input type="hidden" name="item_number" value="Organic-001" />
  <input type="hidden" name="amount" value="17.4" /> 
  <input type="hidden" name="currency_code" value="EUR" /> 
  <input type="hidden" name="notify_url" value="http://www.example.com/paypalnotify.php" /> 
  <input type="submit" name="submit" value="Pay now By PayPal" />
</form>

此表单特定于 PayPal 高级商业账户和给定的支付金额,具有以下关键参数:

  1. business=JohnDoe2@example.com.
  2. 金额=17.4欧元。
  3. currency_code=欧元或美元。
  4. notify_url 作为 PayPal.com 结束时的回调。

通过点击 [提交] 按钮,它会执行以下操作:

  1. 它将客户重定向到 paypal.com 网站。
  2. 用户将登录她/他的 PayPal 帐户,并验证付款。
  3. PayPal 站点将像回调一样调用 paypalnotify.php,传递指示付款是否成功、取消或无效的信息...

现在在使用 PalPal REST API 的新界面中,使用PHP development kit,如何进行付款?

【问题讨论】:

    标签: php api rest paypal


    【解决方案1】:

    有几个选项。首先查看这些文件中的代码:

    https://github.com/paypal/rest-api-sdk-php/blob/master/sample/payments/CreatePayment.php https://github.com/paypal/rest-api-sdk-php/blob/master/sample/payments/CreatePaymentUsingPayPal.php

    显然它们没有任何交互式表单,但它们显示了一般过程。深入研究并创建您的代码。然后,当您遇到问题时,请针对特定问题打开一个新问题。 StackOverflow 不适用于“我如何”类型的问题。 https://stackoverflow.com/help/on-topic

    【讨论】:

      猜你喜欢
      • 2016-02-10
      • 2019-01-15
      • 2018-06-18
      • 2013-06-16
      • 2015-03-20
      • 2011-06-27
      • 2015-07-18
      • 2014-11-11
      • 2014-01-29
      相关资源
      最近更新 更多