gpt4 book ai didi

PayPal HTML 按钮缺少发票参数

转载 作者:行者123 更新时间:2023-12-05 06:57:53 25 4
gpt4 key购买 nike

我实现了一个 Paypal HTML 按钮(支付和订阅)来引导客户到 Paypal 网站进行支付。此外,我将发票编号作为参数传递。根据以下文件,发票是传递变量。

https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/# https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/archive/PP_subscriptions.pdf

事实上,在我的沙盒帐户上进行测试时,我确实收到了所有参数(包括发票)作为 POST 调用。但是,当我测试实时付款(非沙盒帐户)时,未收到发票。但是,我收到了其他付款信息,例如商品编号、自定义、交易 ID 等。此外,对于实时付款,信息是通过 GET 调用而不是 POST 调用传递的。

总而言之,为什么我从沙盒支付中收到发票参数而不是实时支付。

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="message">
<input type="hidden" name="return" value="<%= (request.isSecure() ? "https" : "http") + "://" + request.getServerName() + "/upgradepayment" %>">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="hosted_button_id" value="...">
<input type="hidden" name="business" value="...">
<input type="hidden" name="item_name" value="...">
<input type="hidden" name="notify_url" value="..."
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="a3" value="...">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="invoice" value="...">
<input type="hidden" name="custom" value="...">
<input type="hidden" name="item_number" value="...">
<input id="ok" type="submit" name="submit" value="Pay and Subscribe with PayPal" alt="PayPal - The safer, easier way to pay online" title="PayPal - The safer, easier way to pay online">
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="message">
<input type="hidden" value="<%= (request.isSecure() ? "https" : "http") + "://" + request.getServerName() + "/upgradepayment" %>" name="return">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="...">
<input type="hidden" name="item_name" value="...">
<input type="hidden" name="amount" value="...">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="invoice" value="...">
<input type="hidden" name="custom" value="...">
<input type="hidden" name="item_number" value="...">
<input id="ok" type="submit" name="submit" value="Pay with PayPal" alt="PayPal - The safer, easier way to pay online" title="PayPal - The safer, easier way to pay online">
</form>

编辑:我通过即时付款通知 (IPN) 收到有关订阅的信息

最佳答案

我刚刚使用下面的代码(您的 HTML,但稍作修改)进行了实时支付:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="message">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<BUSINESS_PAYPAL_EMAIL>">
<input type="hidden" name="item_name" value="<ITEM_NAME>">
<input type="hidden" name="notify_url" value="<CALLBACK_URL>"
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="invoice" value="<INVOICE_ID>">
<input type="hidden" name="custom" value="<CUSTOM_OPTIONAL>">
<input type="hidden" name="item_number" value="<ITEM_NUMBER>">
<input type="hidden" name="amount" value="<AMOUNT>">
<input id="ok" type="submit" name="submit" value="Pay and Subscribe with PayPal" alt="PayPal - The safer, easier way to pay online" title="PayPal - The safer, easier way to pay online">
</form>

我用了https://requestbin.com/收集 IPN 回调。这是发票的屏幕截图:

enter image description here

关于PayPal HTML 按钮缺少发票参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64774681/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com