下面是最简单的PayPal接口(interface)形式:
<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 高级企业帐户和给定的支付金额,具有以下关键参数:
- business=JohnDoe2@example.com。
- 金额=17.4EUR。
- currency_code=欧元或美元。
- notify_url 作为 PayPal.com 结束时的回调。
通过单击 [提交] 按钮,它会执行以下操作:
- 它将客户重定向到 paypal.com 网站。
- 用户将登录到她/他的 PayPal 帐户,并验证付款。
- PayPal 站点将像回调一样调用 paypalnotify.php,传递指示付款是否已成功、已取消或无效的信息...
现在在使用 PalPal REST API 的新界面中,使用 PHP development kit , 如何完成付款?
最佳答案
有几个选项。首先查看这些文件中的代码:
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
关于php - 如何将 PayPal 经典支付表单转换为 PayPal REST API PHP 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19187975/