可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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?
回答1:
When you're logged into your test business account, manually navigate to:
https://www.sandbox.paypal.com/ca/cgi-bin/?cmd=_profile-pref&source=acct_setup&fli=true
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.
回答2:
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.
回答3:
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:
回答4:
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.
回答5:
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:
- login to your developer central
- press "test accounts" on the left
- select seller account and press "Enter sandbox test site" on the bottom
- 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:
- 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.
回答6:
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.
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.
回答7:
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@example.com
then all the sandbox payments should be made to email-facilitator@example.com
otherwise they will end up in PENDING mode.
回答8:
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.
回答9:
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.
回答10:
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:
- Login in to PayPal with your Paypal business account
- Go to "Profile" > "Profile and Settings" > “My Money” > “Currencies”
- 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/
回答11:
The solution is what @Jadeye explains:
Go to PayPal Developer Website
- Log in to your developer account (sandbox)
- 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
回答12:
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.
回答13:
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..