Paypal IPN 始终返回“ payment_status: Pending”在沙箱上?
我正在尝试在我的网站上实施 PayPal。
我使用这个类: http://www.micahcarrick.com/php- paypal-ipn-integration-class.html
现在我正在使用 PayPal 沙箱进行测试。
问题如下:
- 用户付款 - 好的
- 用户成功返回我的网站 - 好的
- 几秒钟后 PayPal 使用 IPN 调用我的网站 - 好的
- 我的班级成功验证传入的 IPN 数据。
- PayPal 返回“ payment_status: Pending”
我不知道为什么 PayPal IPN 会回调付款状态为“pending”?
有谁知道我做错了什么?
I'm trying to implement PayPal on my website.
I use this class: http://www.micahcarrick.com/php-paypal-ipn-integration-class.html
Right now I'm testing using the PayPal sandbox.
Here is the problem:
- User makes payment - ok
- User returns to my website succesfully - ok
- After a few seconds PayPal calls my website using IPN - ok
- My class successfully validate incoming IPN data.
- PayPal returns "payment_status: Pending"
I don't know why PayPal IPN calls back with the payment status of "pending"?
Does anyone know what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(14)
登录测试企业帐户后,手动导航至:
https://www. sandbox.paypal.com/businessmanage/preferences/ payments
您通常可以通过“我的商家设置”到达那里,但目前它会重定向到 PayPal live(尽管位于沙箱中)。
进入该页面后,将“阻止以我不持有的货币发送给我的付款”更改为“否,接受它们并将其转换为...”
此外,不要忘记使用PayPal Sandbox 前端和 API 的“测试电子邮件”部分。
When you're logged into your test business account, manually navigate to:
https://www.sandbox.paypal.com/businessmanage/preferences/payments
You would normally be able to get there by going through your "My Business Setup" but currently it redirects to PayPal live (despite being in the sandbox).
Once you're on that page, change "Block payments sent to me in a currency I do not hold" to "No, accept them and convert them to ..."
Also, don't forget to confirm your business account using the PayPal Sandbox front-end and "Test Email" section of the API.
我的问题是我的沙盒商家帐户是作为英国用户创建的(英镑作为货币)。当我尝试以丹麦克朗 (DKK) 处理订单时,它会告诉我,该购买在商家视图中为“无人认领”。一旦丹麦克朗订单被接受,并且我选择创建一种新的丹麦克朗货币,IPN 就会向我发送所有“ payment_status = 已完成”消息。
My problem was that my sandbox merchant account was made as a British user (and GBP as currency). When I tried to go through orders in Danish kroner (DKK), it would tell me that the purchase was "Unclaimed" in the merchant view. As soon as one order in DKK was accepted, and I chose to create a new currency in DKK, IPN sent me all the "payment_status = completed" messages.
稍微处理一下这个问题后; PayPal 更改 UI,
以下是 PayPal 商家技术支持的具体说明:
感谢您联系商家技术支持。
请尝试按照以下说明关闭您的 Sandbox 账户的付款审核功能:
!!! 确保您是在 PayPal SandBox 商家帐户上执行此操作!
&这就是它的样子:
After dealing with this problem a little & PayPal changing the UI,
Here are the exact instructions from PayPal Merchant Technical Support:
Thank you for contacting Merchant Technical Support.
Please try to follow the instructions below to turn off the Payment Review function for your Sandbox account:
!!! Make sure you are doing this on your PayPal SandBox Merchant Account!
& Thats what it looks like:
您可以按照以下说明解决。
登录您的开发人员中心。
单击左侧的“测试帐户”选项卡。您应该已经创建了这些测试帐户以在 Sandbox 上进行测试。
找到“付款审核”列。
找到您正在使用的沙盒帐户,然后在“付款审核”列中单击“启用”。
此选项应更改为“已禁用”,现在从您的余额和信用卡支付的付款将立即完成。
You can resolve it by the following instruction.
Login to your Developer Central.
Click on Test Accounts tab on the left. You should have created these test accounts for testing on Sandbox.
Find the column ‘Payment Review’.
Find the sandbox account you are using and click on “Enabled” in the ‘Payment Review’ column.
This should change to “Disabled” and now payments funded from your balance and credit card will complete instantly.
两个可能的原因:
1。卖家帐户可以选择接受或拒绝付款
在这种情况下,您需要以卖家身份登录并接受付款,您将获得另一个 IPN,其中 payment_status=Completed
步骤:
2。付款审核已启用
解决方案:
这应该更改为“已禁用”,现在从您的余额和信用卡中支付的付款将立即完成。
Two possible reasons:
1. seller account has option to accept or decline payment
In this case you need to login as seller and accept payment and you will get another IPN with payment_status=Completed
Steps:
2. Payment review is enabled
Solution:
This should change to “Disabled” and now payments funded from your balance and credit card will complete instantly.
我做了更改
允许以我不持有的货币向我发送付款
在沙盒中的所有用户帐户中将其设置为是
,但仍然如此不工作。我还尝试在 PayPal 表单中以及沙盒用户帐户中创建相同的货币此处 将新货币设为主要货币。将钱兑换成新货币。仍然没有成功。
然后我注意到 Wes Hanney 回答的最后一句话:“使用 PayPal Sandbox 前端确认您的企业帐户”。 尝试此操作也不起作用。
MGPalmer 在他的回答中建议创建一个德国商人帐户。也没有用。
真是麻烦啊!
一小时后,当我差点把电脑扔出窗外时,我突然意识到我忘记了一件事。将 PayPal 表单中我的真实收件人电子邮件地址更改为沙盒商家电子邮件地址。这最终为我解决了这个问题。
PS:也许是一个愚蠢的初学者错误?但可能对遇到同样情况的其他人有帮助。
I did change
Allow payments sent to me in a currency I do not hold
toYes
in all user accounts in the sandbox but it was still not working.I also tried to create the same currencies in the paypal form, and for the sandbox user accounts here Making the new currency primary. Converting money to the new currency. Still no success.
Then I noticed the last sentence of Wes Hanney's answer: "confirm your business account using the PayPal Sandbox front-end". Trying this did not work either.
M.G.Palmer's suggested in his answer to create a German merchant account. Did not work either.
What a hassle!
After one hour, where I was close to throw the PC out of the window, I just realized that I forgot one thing. Changing my real recipient email address in the paypal form to the sandbox merchant email address. That solved it finally for me.
PS: Maybe a stupid beginner's mistake? But might be helpful for others who run into the same situation.
我遇到了同样的问题,这里的建议都不起作用。然后我意识到问题是我试图从沙盒账户向真实账户付款。例如,如果您注册的企业帐户是:
[电子邮件受保护]
那么所有沙盒付款均应支付至[email protected ]
否则它们将最终处于 PENDING 模式。I had the same problem, and none of the suggestion here worked. Then I realized the problem was that I was trying to make a payment from a sandbox account to a live account. So for example if your registered business account is:
[email protected]
then all the sandbox payments should be made to[email protected]
otherwise they will end up in PENDING mode.上述解决方案对我不起作用,但帮助我找到了解决方案。
如果您使用默认的企业和买家帐户,也许此解决方案适合您。
转到 developer.paypal > sandbox.accounts
https://developer.paypal.com/developer/accounts/
登录并点击您的 sandobx 企业帐户和买家帐户中的克隆图标
设置新名称 > 和电子邮件,然后单击创建新帐户
打开两个帐户的个人资料,并确保付款审核处于关闭
编辑代码/应用中的目标帐户并放置新的企业帐户
重复交易>买家帐户
此解决方案不仅解决了我的问题。多亏了它,sandox.paypal 设计更改为使用真实帐户的新设计。
这很重要,因为在这种情况下,IPN 收到的某些数据可能会以不同的名称进行响应。
No solutions above worked for me, but helped me to find the solution.
If you are using de default business and buyer account, maybe this solution will work for you.
Go to developer.paypal > sandbox.accounts
https://developer.paypal.com/developer/accounts/
Login and click on clone icon in your sandobx business account and your buyer account
Set new names and emails and click create new account
Open the profile of both accounts and make sure Payment Review is OFF
Edit your target account in your code/app and place the new business account
Repeat transaction using the new buyer account
This solution not just resolved my problem. Thanks to it the sandox.paypal design changed to the new design that uses real accounts.
This is important because some of data received by IPN in this case, may respond at different name.
这里有类似的问题 - 我的(沙盒)商家帐户是在美国创建的,我正在尝试进行欧元付款。
对我来说,更改哪些设置并不重要,只有在创建位于德国的新商家帐户后才有效。
Similar problem here - my (sandbox) merchant account was created as in the US, and I was trying to do EUR payments.
For me, it didn't matter which settings I changed, it only worked after creating a new merchant account based in Germany.
默认情况下,您的 PayPal 企业帐户仅限于根据您的区域设置选择的几种可接受的货币。使用不接受的货币进行的付款将保持待处理/未结状态。要支持/接受这些货币,您需要将它们添加到 PayPal 上的“接受的货币”列表中。为此,请按照以下步骤操作:
备注:在测试时使用沙盒帐户时,您还需要在使用 URL 登录该帐户后为您的辅助沙盒帐户执行此操作: https://www.sandbox.paypal.com/
By default, your PayPal business account is limited to a few accepted currencies that are chosen based on your regional settings. Payments made with non-accepted currencies will stay in pending/open status. To support/accept those currencies, you need to add them to the list of "accepted currencies" on PayPal. To do so, follow these steps:
Remark: When using the sandbox accounts when testing, you need to perform this also for your facilitator sandbox account after login on this account using URL: https://www.sandbox.paypal.com/
解决方案是 @Jadeye 解释的:
转到 PayPal 开发者网站
The solution is what @Jadeye explains:
Go to PayPal Developer Website
您可能还需要检查一件事:
确保您的 PayPal 帐户的语言编码设置为 UTF-8。在某些情况下,可将其设置为“windows-1256”之类的内容默认。
要将其更改为 UTF-8,您需要:
我在德国设置的每个 Paypal 帐户默认都设置为语言编码“windows...”。那么 IPN 将无法与 UTF-8 编码的网站配合使用,即使在 Woocommerce、EDD 或 event espresso 中也是如此。
There is one more thing you may need to check:
Make shore that the language encoding of your PayPal account is set to UTF-8. Under some circumstances this is set to something like ‘windows-1256’ by default.
To change it to UTF-8 you need to:
Every single Paypal account I've setup in Germany was set to language encoding "windows..." by default. Then IPN won't work with an UTF-8 encoded website, even in Woocommerce or EDD or event espresso.
我通过删除所有沙箱帐户并重新创建它来解决我的问题。
重要提示:
确保帐户使用与您的代码相同的货币。
I solved mine by deleting all sandbox account and recreated it.
Important NOTES:
Make sure the accounts are using the same currency with your code..
就我而言,问题是从 paypal 的凭据选项卡复制凭据给出“xxxx_api1.example.com”。如果您在“用户名”、“帐户 ID”字段中输入此内容,则它将不起作用。您必须输入电子邮件。仔细看,邮件里有@。因此,您必须在用户名中输入“[email protected]”和 accountid 字段。我希望这对你有用,因为它对我有用。我还从设置中禁用了付款审核。
In my case, the problem was copying credentials from the credential tab in paypal was giving "xxxx_api1.example.com". If you enter this in your "username", "account id" field, it won't work. You must enter the email. Look carefully, emails have @ in it. So you must've entered "[email protected]" both in your username and accountid field. I hope this works with you because it worked with me. I also disabled Payment Review from settings.