Paypal IPN 始终返回“ payment_status: Pending”在沙箱上?

发布于 2024-10-04 19:35:08 字数 490 浏览 9 评论 0原文

我正在尝试在我的网站上实施 PayPal。

我使用这个类: http://www.micahcarrick.com/php- paypal-ipn-integration-class.html

现在我正在使用 PayPal 沙箱进行测试。

问题如下:

  1. 用户付款 - 好的
  2. 用户成功返回我的网站 - 好的
  3. 几秒钟后 PayPal 使用 IPN 调用我的网站 - 好的
  4. 我的班级成功验证传入的 IPN 数据。
  5. 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:

  1. User makes payment - ok
  2. User returns to my website succesfully - ok
  3. After a few seconds PayPal calls my website using IPN - ok
  4. My class successfully validate incoming IPN data.
  5. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

素衣风尘叹 2024-10-11 19:35:08

登录测试企业帐户后,手动导航至:

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.

度的依靠╰つ 2024-10-11 19:35:08

我的问题是我的沙盒商家帐户是作为英国用户创建的(英镑作为货币)。当我尝试以丹麦克朗 (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.

梦回旧景 2024-10-11 19:35:08

稍微处理一下这个问题后; PayPal 更改 UI,

以下是 PayPal 商家技术支持的具体说明:

感谢您联系商家技术支持。

请尝试按照以下说明关闭您的 Sandbox 账户的付款审核功能:

  • 前往 PayPal 开发者网站
  • 登录您的开发者帐户
  • 单击“应用程序”
  • 单击“沙盒帐户”
  • 单击您要关闭“付款审核”选项的电子邮件地址,然后在展开后单击“个人资料”
  • 单击“设置”
  • 并选择“关闭付款审核”。
  • 单击“关闭”

!!! 确保您是在 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:

  • Go to PayPal Developer Website
  • Log in to your developer account
  • Click Applications
  • Click Sandbox accounts
  • Click on to the email address that you would like to turn off the Payment Review option and click Profile after it expand
  • Click Settings
  • And select Off for the Payment review.
  • Click Close

!!! Make sure you are doing this on your PayPal SandBox Merchant Account!

& Thats what it looks like:

enter image description here

阳光下慵懒的猫 2024-10-11 19:35:08

您可以按照以下说明解决。

  1. 登录您的开发人员中心。

  2. 单击左侧的“测试帐户”选项卡。您应该已经创建了这些测试帐户以在 Sandbox 上进行测试。

  3. 找到“付款审核”列。

  4. 找到您正在使用的沙盒帐户,然后在“付款审核”列中单击“启用”。

  5. 此选项应更改为“已禁用”,现在从您的余额和信用卡支付的付款将立即完成。

You can resolve it by the following instruction.

  1. Login to your Developer Central.

  2. Click on Test Accounts tab on the left. You should have created these test accounts for testing on Sandbox.

  3. Find the column ‘Payment Review’.

  4. Find the sandbox account you are using and click on “Enabled” in the ‘Payment Review’ column.

  5. This should change to “Disabled” and now payments funded from your balance and credit card will complete instantly.

如果没有 2024-10-11 19:35:08

两个可能的原因:

1。卖家帐户可以选择接受或拒绝付款

在这种情况下,您需要以卖家身份登录并接受付款,您将获得另一个 IPN,其中 payment_status=Completed

步骤:

  1. 登录您的开发者中心
  2. ,按左侧的“测试帐户”
  3. 选择卖家帐户并按底部的“输入沙盒测试站点”
  4. 您应该会看到卖家仪表板,其中包含接受或拒绝任何付款的选项(您可能需要在此步骤使用卖家测试帐户凭据重新登录)

2。付款审核已启用

解决方案:

  1. 登录您的开发者中心。
  2. 单击左侧的测试帐户选项卡。您应该创建这些测试帐户以在沙盒上进行测试。
  3. 找到“付款审核”列。
  4. 找到您正在使用的沙盒帐户,然后单击“付款审核”栏中的“已启用”。

这应该更改为“已禁用”,现在从您的余额和信用卡中支付的付款将立即完成。

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:

  1. login to your developer central
  2. press "test accounts" on the left
  3. select seller account and press "Enter sandbox test site" on the bottom
  4. You should see seller dashboard with option to accept or decline any payment (you might need to relogin at this step using seller test account credentials)

2. Payment review is enabled

Solution:

  1. Login to your Developer Central.
  2. Click on Test Accounts tab on the left. You should have created these test accounts for testing on Sandbox.
  3. Find the column ‘Payment Review’.
  4. 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.

泅渡 2024-10-11 19:35:08
  1. 我做了更改 允许以我不持有的货币向我发送付款 在沙盒中的所有用户帐户中将其设置为,但仍然如此不工作。

  2. 我还尝试在 PayPal 表单中以及沙盒用户帐户中创建相同的货币此处 将新货币设为主要货币。将钱兑换成新货币。仍然没有成功。

  3. 然后我注意到 Wes Hanney 回答的最后一句话:“使用 PayPal Sandbox 前端确认您的企业帐户”。 尝试此操作也不起作用。

  4. MGPalmer 在他的回答中建议创建一个德国商人帐户。也没有用。

真是麻烦啊!

一小时后,当我差点把电脑扔出窗外时,我突然意识到我忘记了一件事。将 PayPal 表单中我的真实收件人电子邮件地址更改为沙盒商家电子邮件地址。这最终为我解决了这个问题。

PS:也许是一个愚蠢的初学者错误?但可能对遇到同样情况的其他人有帮助。

  1. I did change Allow payments sent to me in a currency I do not hold to Yes in all user accounts in the sandbox but it was still not working.

  2. 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.

  3. 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.

  4. 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.

假装爱人 2024-10-11 19:35:08

我遇到了同样的问题,这里的建议都不起作用。然后我意识到问题是我试图从沙盒账户向真实账户付款。例如,如果您注册的企业帐户是:[电子邮件受保护] 那么所有沙盒付款均应支付至 [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.

转角预定愛 2024-10-11 19:35:08

上述解决方案对我不起作用,但帮助我找到了解决方案。

如果您使用默认的企业和买家帐户,也许此解决方案适合您。

  1. 转到 developer.paypal > sandbox.accounts
    https://developer.paypal.com/developer/accounts/

  2. 登录并点击您的 sandobx 企业帐户买家帐户中的克隆图标

  3. 设置新名称 > 和电子邮件,然后单击创建新帐户

  4. 打开两个帐户的个人资料,并确保付款审核处于关闭

  5. 编辑代码/应用中的目标帐户并放置新的企业帐户

  6. 使用新的企业帐户

    重复交易>买家帐户


此解决方案不仅解决了我的问题。多亏了它,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.

  1. Go to developer.paypal > sandbox.accounts
    https://developer.paypal.com/developer/accounts/

  2. Login and click on clone icon in your sandobx business account and your buyer account

  3. Set new names and emails and click create new account

  4. Open the profile of both accounts and make sure Payment Review is OFF

  5. Edit your target account in your code/app and place the new business account

  6. 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.

请爱~陌生人 2024-10-11 19:35:08

这里有类似的问题 - 我的(沙盒)商家帐户是在美国创建的,我正在尝试进行欧元付款。

对我来说,更改哪些设置并不重要,只有在创建位于德国的新商家帐户后才有效。

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.

娇女薄笑 2024-10-11 19:35:08

默认情况下,您的 PayPal 企业帐户仅限于根据您的区域设置选择的几种可接受的货币。使用不接受的货币进行的付款将保持待处理/未结状态。要支持/接受这些货币,您需要将它们添加到 PayPal 上的“接受的货币”列表中。为此,请按照以下步骤操作:

  1. 使用您的 Paypal 企业帐户登录 PayPal
  2. 转到“个人资料”> “个人资料和设置”> “我的钱”> “货币”
  3. 添加您想要支持的货币。

备注:在测试时使用沙盒帐户时,您还需要在使用 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:

  1. Login in to PayPal with your Paypal business account
  2. Go to "Profile" > "Profile and Settings" > “My Money” > “Currencies”
  3. Add the currencies you want to support.

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/

我做我的改变 2024-10-11 19:35:08

解决方案是 @Jadeye 解释的:

转到 PayPal 开发者网站

  1. 登录到您的开发者帐户(沙箱)
  2. 单击“应用程序”
  3. 单击“沙箱帐户”
  4. 单击您要关闭“付款审核”选项的电子邮件地址,然后在展开后单击“个人资料”
  5. 单击“设置”
  6. 并为“付款审核”选择“关闭”。
  7. 单击关闭

The solution is what @Jadeye explains:

Go to PayPal Developer Website

  1. Log in to your developer account (sandbox)
  2. Click Applications
  3. Click Sandbox accounts
  4. Click on to the email address that you would like to turn off the Payment Review option and click Profile after it expand
  5. Click Settings
  6. And select Off for the Payment review.
  7. Click Close
对岸观火 2024-10-11 19:35:08

您可能还需要检查一件事:

确保您的 PayPal 帐户的语言编码设置为 UTF-8。在某些情况下,可将其设置为“windows-1256”之类的内容默认。
要将其更改为 UTF-8,您需要:

  • 进入您的个人资料,然后进入“我的销售工具”
  • ,在底部单击“PayPal 按钮语言编码”
  • 在下一页上,您需要单击“更多选项”,您可以最后设置编码

我在德国设置的每个 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:

  • go into your profile then “my selling tools”
  • there, at the bottom click on “PayPal button language encoding”
  • On the next page you need to click on “More Options” where you can finally set the encoding

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.

別甾虛僞 2024-10-11 19:35:08

我通过删除所有沙箱帐户并重新创建它来解决我的问题。

重要提示:

确保帐户使用与您的代码相同的货币。

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..

百合的盛世恋 2024-10-11 19:35:08

就我而言,问题是从 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文