gpt4 book ai didi

c# - Paypal 返回 URL 未正确触发

转载 作者:行者123 更新时间:2023-11-30 12:55:34 25 4
gpt4 key购买 nike

我们的网站有以下一次性付款按钮。

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="custom" value="@Model.UserId.ToString()">
<input type="hidden" name="notify_url" value="http://www.testweb.com/paypal/IpnHandler">
<input type="hidden" name="return" value="http://www.testweb.com/paypal/Onetimeyearlysuccess">
<input type="hidden" name="cancel_return" value="http://www.testweb.com/paypal/cancel">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8xxxxxxC">
<input type="image" src="@Url.Content("~/images/OneTime55year.png")" border="0" name="submit" style="width: 130px !important; height: 47px !important;" alt="PayPal - The safer, easier way to pay online!" >
</form>

完成 paypal 付款后,我们可以看到出现 404 错误。问题是我们得到了错误的 URL。

https://www.testweb.com/PaypalOnetimeyearlysuccess?amt=55.00&cc=USD&cm=22028&item_name=oneTimeAnnual55&st=Completed&tx=59M0424544743135Y

我们不知道为什么 paypal 后面的斜杠不见了。

正确的网址应该是

https://www.testweb.com/Paypal/Onetimeyearlysuccess?amt=55.00&cc=USD&cm=22028&item_name=oneTimeAnnual55&st=Completed&tx=59M0424544743135Y

地址URL中paypal后面需要有斜杠符号。

您还可以从 paypal 按钮的返回 URL 中看到正确的 URL。

为什么重定向到错误的地址?

同样出于测试目的,我们更改了 paypal 按钮的返回 URL。我们简单地修改为“http://www.testweb.com/paypal/Onetimeyearlysuccesstest

但我们可以看到在更改返回 URL 后,paypal 没有重定向到修改后的 URL。

实际上我们很困惑,我们需要知道返回 URL 在哪里创建。

最佳答案

PayPal 只识别'return'变量的值。关键点位于此 URL ( http://www.testweb.com/paypal/Onetimeyearlysuccess )。建议您创建一个没有重定向功能的固定单页,如.html、.php、.aspx 等,以查看结果。

关于c# - Paypal 返回 URL 未正确触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47771348/

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