Google universal analytics detects the payment/authorization terminal as the referral - php

When the customer selcts Visa/Mastercard as the payment method, they're sent to an external payment terminal to make the actual payment (NETS BBS). After inputting their card data they're then sent to an authorization terminal (3D Secure), if their bank supports it, to verify their payment. At the end they're sent back and is presented with a "Thank you" page. And this is where the google ecommerce tracker is executed.
But what happens is that "mpi1.3dsecure.no" gets detected as the referral. This is the authorization terminal where the customer verified their payment. This is to some degree correct since it's where they entered the "Thank you" page from, but is not what we're looking for. We want to know where the customer came from into the site to begin with.
Has anyone wxperienced this behaviour, and know of a workaround to this?
Tried to put the google code before being sent to the external payment site, but that can provide unaccurate results since not all payment succeeds...

Go to the property settings and add your payment gateway to the referral exclusion list (won't change data already recorded but should fix the problem for future transactions).

Related

Get Paypal's transaction using the REST API with only a receipt number

Okay so I've setup a website with a basic paid subscription using Paypal. Here's the general flow of things:
1) A person fills up a basic subscription form and click subscribe
2) They get forwarded to Paypal who handles the payment
3) User clicks on "back to website" button
4) Account gets activated and user is forwarded to splash page
The thing is that if the user decides to close the window instead of clicking "Back to website", then his account will remain locked even though he paid (and yes, I'm aware you can skip the "back to website" button, but my client wants to keep it).
So, what I'd like to do is basically implement a form that will query Paypal's REST api to check if the user's receipt number actually exists and if so, complete his subscription. The problem is that most of the users pay through credit card, not Paypal... so all they have is a receipt number.
I've searched through the documentation and I can't seem to find how to query Paypal's REST API using the receipt number. Can anyone point me in the right direction?
I use the IPN service provided by PayPal. With this, I pass a custom field along with the transaction containing the user's account number (you could use receipt number as long as you have it stored). I have an IPN Handler script that receives the verification from PayPal that the transaction completed successfully. This script receives the custom field, which can then be used to locate the user's account and update their subscription status.

Processing Authorize.net relay response with PHP

I am kind of a newbie when it comes to online CC processing integration. I am in the Sandbox at Authorize.NET trying to configure my server to process SIM orders where the payment page form resides on the Authorize.net servers and processes the order. By default it looks like the confirmation is on their sites, and e-mails can be configured to be sent to the buyer and the seller. That is all working in the Sandbox. However, I am trying to capture some of the order and processing information on my server using the relay response. My processing page is accessible on my server, although I must say that I have .htaccess limited intermittently because it is still in development. I turn that off when I am testing.
The error that I am getting is:
An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.
I can't tell if they are POSTING data to my page or not, and I'm not really clear on what goes on the response page and how to parse the response. I am using the PHP SDK provided by Authorize.NET. The rest seems to be working. I am getting e-mails for the buyer and the seller and the order is proccessed but I'm not capturing the information on our server. What I would like to do is bypass their confirmation page, receive the relay response, create a custom confirmation and capture some of the data for our database. I'll keep digging because I made a fair amount of progress just reading the docs. This one is particularly useful.
Thanks.
I figured it out. There was an error on the page giving a "500" error. I have to say, it is a little strange the way they have it set up. They are POSTING to my page, where I am capturing the POST data, writing stuff to a database, and then creating a custom confirmation message, although it must be via a header redirect because it shows up on their server (their domain is in the address bar). It all works, but apparently, any SESSION variable values are not available to my script in that case?

Best practice for crediting users account with PHP MySQL and paypal express checkout

I am integrating PayPal Express Checkout API into a digital goods/services website. I worked out all the technical stuff, but now I have a theoretical question - when the transaction is done and I get a confirmation from PayPal, what is the best way to store that acknowledgement from paypal, and credit my user's account?
The ConfirmPayment() function in the paypal library returns from paypal with an associative array, including a transaction ID, and acknowledgement that I have the user's money in my business account.
So my plan is, store that transaction ID as a unique value in a SQL table, so if the user for example reloads the confirmation page, which would then re-call ConfirmPayment($token), my PHP script won't just credit their account a second time, because the SQL table will return a unique ID error.
How are smart programmers integrating this last payment confirmation into the rest of their application?
THANKS.
I would do it like so:
Keep a full log of all the messages your receive from Paypal. Just the RAW data should be fine. Then beyond that point don't need that much traceability. If anything ever happens you can check the log. This should really never happen, if you need to look at this log a lot to resolve any issues you have a different kind of problem. This is why my suggestion is: don't put too much time into it, but make sure you have traceability (albeit a very crude one).
If the user reloads the confirmation page, Paypal will not send you another message. Keep in mind that you should only accept transactions that Paypal has verified. The user should not be able to validate his own transactions by bypassing Paypal.

PayPal Pro : is it necessary to gather details oneself or can PayPal do that for me?

I know that with PayPal Pro, the user enters his information on my site and PayPal processes that in the background.
Still, is it possible to have it like with PayPal standard : the user gets redirected to PayPal site, enters his information there, pays there, and come back ?
I'm asking cause my client has PayPal Pro, however I don't feel comfortable with gathering payment data myself. I would prefer PayPal to do that for me.
Short answer: Yes, you can use IPN.
Longer answer:
Either way you want to have an SSL certificate, and to handle various payment information.
If you're using IPN, the user gets redirected to the PayPal site, pays, and gets redirected back, and you receive a notification to one of your scripts. That script will have to check if the data you receive is similar to what you sent, and other checks. You may not receive the notification instantly, sometimes it takes a few days to get it (very rarely though).
With PayPal Pro, the user enters his credit card details and submits them. You will have to make some checks here, but after that you send the info to PayPal, and you receive the response (either success or response) - instantly.
These are the major differences, it's nothing mind boggling one way or the other, you just need to use the API documentation.

Google Analytics E-Commerce Tracking without visible thankyou page

I use Google E-Commerce Tracking to track sales and offer different payment methods.
For credit card payment and Paypal the user is redirected to a thankyou page after successful payment and the Google E-Commerce Tracking code is executed there. That works fine.
I also offer barcode bills and ibon as payment method. That means the user prints a bill with a barcode or ibon code and goes to a 7-11 to pay it with cash. The information about the payment is sent from 7-11 to my payment provider and they send me a notification about a successful payment back to my notification url. It normally takes 2 days until I receive this notification.
My problem is:
In this case there is no website displayed to the user where I can enter the E-Commerce Tracking code. The notification url is a page with php only and updates the database.
So, how do I execute the Google E-Commerce Javascript on a php page which is not displayed in the browser?
check out the Google Measurement Protocol Developer Guide, that describes how to send the data with HTTP requests, so you can do it for example with PHP and cURL
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide
https://developers.google.com/analytics/devguides/collection/protocol/v1/reference

Categories