Paypal CreateRecurringPaymentsProfile causing a timeout - php

I'm trying to complete a transaction on paypal sandbox and my request always return timeout error.
I've look everywhere for this problem that seems to be pretty recurrent but no solutions seems to work for me.
Thanks!

Finally, I've found solutions to my problem.
as pointed out by ppmtscory on the php-Paypal-SKD github forum, you shoud not use credit card number 4111111111111111 because it as been overused and it is flagged as so in the system and cause this type of behavior.
https://github.com/paypal/PayPal-PHP-SDK/issues/519
#artisangang I will be closing this issue as it doesn't have to do with the SDK itself. This is due to the specific testing card number being overused in the system causing a timeout. #pp-randy has already filed the internal ticket to do a DB update to try and correct this for the sandbox environment but it's not something that will likely get very high priority. If you need test credit cards, please visit this page and utilize Step 4.

Related

Paypal transaction completed but empty response from api (Random)

I am using PayPal API of php. It was ok since 2 years but now its creating problems for some customers. Some of the orders are fine but for few users, the transaction is completed but API doesn't response (throw empty response).
I don't think it will be because of code issue. I am unable to track the issue. Anyone know, why it's showing the random behavior.
The interesting thing is, for the same customer, doing the second time transaction, it works fine. Totally random behavior. Please need expert suggestion.
Please contact PayPal Merchant Technical Support, provide with your PayPal account and API request example which go empty response.
https://www.paypal-techsupport.com/

Paypal error - getTransactionFee method does not exist

I have a custom website with a custom shopping cart built in. I am using the Paypal API Standard Payments method to send the shopping cart information over to Paypal & then returning on a return URL to my order_process.php page. Once it returns to my website, the code updates information in our database to sign members up for events, give them a membership etc.
Everything was working fine until Paypal flagged our account due to the high increase in payments coming in within a short period of time.
I spoke with a supervisor over at Paypal & they lifted the flag from our account.
We did not change anything on our end but now the site is not working properly anymore. It sends the information over to Paypal, takes the payment successfully & comes back to our site.
Once it gets to the line in code
$result = execute_payment($_SESSION["payment_id"], $_GET["PayerID"]);
It crashes with an error: "Method PayPal\Api\Sale::getTransactionFee() does not exist"
I've spoken to Paypal numerous times and they keep saying they will call me back with no return phone calls. I've extensively Googled this error and cannot find anything on this topic. I'm at a lost of what to try next and this is causing a lot of disruption because we are processing a high amount of transactions. I switched the site over to a development domain and tried on Sandbox mode and am still receiving the same error message.
Any help at all will be greatly appreciated.
Our site has just started displaying this behaviour too, I don't understand what is going on. It was working perfectly this time last week.
Maybe there is a new version of the PayPal PHP SDK I need to download!?!?
Help!
-- UPDATE: found this on the PHP SDK wiki: "Seeing this error: 'Method PayPal\Api\Sale::getTransactionFee() does not exist' in paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Common/PPReflectionUtil.php:73, Please upgrade the SDK to latest version v1.2.1."
See https://github.com/paypal/PayPal-PHP-SDK/wiki
I've downloaded the new SDK and am integrating it now. Will update when done ...
-- Another Update: Updated our test site to use version 1.2.1 of PHP SDK, and everything works fine against the sandbox. Not sure which language/SDK you're using, but might be worth an update?
I just spoke with an engineer over at Paypal. Apparently they updated some of their code and are aware of this issue. They are currently working on a fix to the problem.

Handling errors during Paypal payment execution

I'm using PayPal REST API v1 for handling payments and from time to time I get errors during payment execution (.../payments/PAY-XXXXXX/execute). Specifically I have run into TRANSACTION_REFUSED and PAYMENT_STATE_INVALID so far. What is the correct way to handle them? Documentation isn't very extensive about these.
From what I understand, TRANSACTION_REFUSED means a problem with Payer account such as rejected card transaction or insufficient funds. In that case I display an erro message that PayPal has refused the transacation and user should try again. Is this a way to go?
PAYMENT_STATE_INVALID is a mystery to me. I get that the payment should be in another state but how do I check if it has a correct state after creation? And how should I handle this error?
Thanks for any suggestions!
I'm using standard php sdk, version from 5. 5. 2014.
This is only a partial answer to the PAYMENT_STATE_INVALID question. You can get the current status of the payment by fetching the "self" URL you initially got from the payment. That way, you can confirm the state of the payment, and maybe try and deduce why it's in the wrong state.
In my judgment, you should need to "handle" this error, since if you do the preceding steps correctly, the payment should always be in the correct state when you try to execute it.
As for the TRANSACTION_REFUSED question, I too would very much like to know.

Accurately reporting referrer from payments made with PayPal in Google Analytics

In our Google Analytics ecommerce PayPal is getting credit as the referrer. I've found many articles outlining use on the utmnooveride to ensure PayPal transactions pass the data so that the original referrer gets credit.
We use PayPal to process our credit cards as well as allow people to pay with their PayPal account. When a visitor pays with credit card they never leave our site, so we are only seeing this inaccuracy when a user leaves our site to pay with their PayPal account.
More accurately we are using PayPal express checkout and using NVP (name value pair) API. https://developer.paypal.com/docs/classic/api/NVPAPIOverview/
We've implemented the suggestions and code changes we have found but PayPal is still getting credit.
We've even talked with PayPal and Google techs and aren't getting any thing more from them than what we are finding online.
Is anyone else encountering this issue, have you found a solution or have any suggestions? Your help is much appreciated.
-- Solution Update --
Moved to the answers.
Per request.. I am moving the answer from a followup in the question to the actual answer.
Based on some various articles on how to improve accuracy of data reporting I just happened to be messing with property settings in Analytics and came across the Referral Exclusion List. I've mostly used this to just cancel out links from other sites in our domain structure; subdoimain.foosite.com -> foosite.com, but decided to investigate adding PayPal to this and came across this support doc from Google.
After reading that article I wondered what would happen. The result = NO MORE PAYPAL referrals and referrals from the original source without having to worry about utm=nooverride=1 usage.
I have verified with a Google support specialist that the below has no negative effects on ecommerce reporting and they have submitted my case to their help team for future use. He also mentioned that this methodology actually recently added which is why there is little documentation about it.
Here is how.
Make sure you are using Universal Analytics
Admin -> Property Settings -> Tracking Info -> Referral Exclusion List
Add Referral Exclusion
Insert referral domain - my case was paypal.com but you may have this issue with others - key here is to identify any domain that might be hijacking ecommerce transactions. So if you are seeing anything that has ecommerce credit that you don't think should; add it
This should solve the problem but I would suggest taking things a few steps further.
Adjust your session settings. Admin -> Property Settings -> Tracking Info -> Session Settings
A few notes about session settings- depending on your site and how users engage I would initially adjust the session timeout so that session is longer than 30 mins. I set mine to 2 hours for testing. Then for campaign timeout I set it 1 day (much shorter time than our normal campaigns.
This allowed me to initially see that it was indeed eliminating PayPal from the referral source and but that my transactions in GA matched my internal reports.
After verification I set the session timeout to 45 mins - 15 mins longer than our site session settings and set the campaign timeout to 7 days.
Make use of Google URL builder and add parameters to your URLs.
This is not only good practice it saves you tons of time trying to segment out your referral sources in GA. It is especially helpful if you collect acquisition source in your internal reports or logs because you can compare those to GA to ensure you are getting accurate ecomm numbers from GA.
Let me share my experience with the 'referral exclusion list' in UA:
I added paypal.com and another similar payment provider to the list.
Consequence:
The traffic attributed to those referrers was reduced from that moment on - but far from beeing zero. (Let's say it was halfed.)
No idea why it is working for parts of the traffic only.
Just wanted to add my answer in case anyone comes across this same issue.
From my understanding the following no longer works with newer GA code:
utm_nooverride=1
However if you pass the _ga parameter google analytics will be able to relate the two instances before being transferred to paypal. Okay great so all you have to do is add the _ga parameter to the return URL...but how do you get it?
Unfortunately you need to grab it client side first:
ga(function(tracker) {
var linkerParam = tracker.get('linkerParam');
});
Hope this helps someone.
Reference
https://ecommerce.shopify.com/c/ecommerce-marketing/t/tracking-true-referrals-in-google-analytics-when-using-paypal-163514
https://developers.google.com/analytics/devguides/collection/analyticsjs/cross-domain
I just wanted to add my experience. I have been having the very same problem, and as you have mentioned the solution is putting paypal.com on the Referral Exclusion List. You must be upgraded to the new Google Universal Analytics in order for to have access to it.

PayPal sandbox anomalies

When testing some donations on my local machine, I set various key=value pairs to do various things (return to specific thank you page, get POST data from PayPal and not GET data and others) I also built my code around the response from the PayPal sandbox.
BUT, when my code goes to the production server and we switch on live payments and test with real accounts and money, a few strange things happen;
We get a GET response from PayPal - the URL is filled with crap.
We get no transaction details. This is the biggie, no name, no txn_id, no dates, nothing. We get a handful of keys etc, its not totally empty and the payment has gone through, but nowhere near the verbosity of the sandbox.
Curious about why this might be? It doesn't really make sense to have a sandbox (or dev environment) that is substantially different from the production environment. Or, am I missing something?
EDIT: Still no response to my question in the PayPal Developer Forums. I don't even get a donation amount back from PayPal. Is this a setting maybe?
EDIT #2: Two of you have suggested to check PDT and Auto-Return. The data analytics guy for the project only 2 hrs ago suggested the same. I have asked the client to confirm this. I can't see a setting for it in the Sandbox so can assume that it is enabled by default?
Are you sure you have all of the PDT and Auto-Return stuff configured the same on your live account as you do on the Sandbox account? There hasn't been much help from PayPal in the x.com forums. I'd recommend posting a ticket to www.paypal.com/mts, although, they've been a little bit slow there, too. If you login to your account, though, and go into the Contact by Phone section, you'll see a direct phone number for tech support. This is probably your best bet.

Categories