Worldpay - how to send form data back to our server? - php

I'm integrating Worldpay with a Wordpress site - our customer completes a form on our site and is then sent to Worldpay to make the payment.
Upon success, Worldpay fetches the content of redirect.php from our server and displays it as a success message at secure-test.worldpay.com.
In order to return the customer back to our site a meta-refresh is implemented (if a 200 response code isn't detected by Worldpay they show a default thank you page). I therefore can't save the POST data to a session or similar.
How can I transmit the Worldpay POST data back to our server securely? I don't think that adding the data as URL parameters in the meta-refresh is an option as it would contain personal data.

Related

how to get payment response if my server stop working when callback url call by payment getway

I am working on stripe payment getaway one question is arising in my mind.this question in few steps i have defined below.
customer generate a payment request on my server
after input successful details customer request submitted on stripe.
stripe payment getaway done their process and they send me response either success or failure.
now what happen when stripe send me success or failure that time my server stopped working. then obviously i am not able to save stripe response in my tables. even i don't have record what my customer paid to my website.
so how would we know the stripe response even after my server stopped working on stripe callback.
i am using PHP for this.
I note that you originally tagged this question with PayPal. You should understand that Stripe works differently how a conventional PayPal checkout flow would work.
With PayPal the shopper arrives at the end of your checkout flow, they click a link to get transferred to PayPal, they login/register, confirm their card details and then PayPal sends a callback to your server. This is where your point about your server being down is relevant.
With Stripe Checkout the flow is different. You add the Stripe javascript code to the final page of your checkout, this triggers a panel (like a modal window) where the shopper enters their card details. Upon submission Stripe generates a token for the card and then adds this as a hidden fields to the form on your site.
You set the form action to point to some code on your server. Upon submission your PHP script then takes the token and processes a payment.
At no point is there a callback between Stripe and your site. Instead you take the payment in a single call from your server. Once you get a response from this API call then you can log the order in your database, send confirmation emails, etc.
Hope this helps.

Expecting tx value to be returned by PayPal but getting empty POST request

I am setting up an e-commerce website using PayPal as a gateway. I have my return URL on my PayPal developer account, and indeed PayPal does redirect me there when I have completed my payment. (I am using a sandbox account.)
However, I am expecting PayPal to include a tx value in their request. For the given page, my PHP script simply echoes var_dump($_REQUEST) and shows an empty array when I'm redirected there from PayPal.
I have tried sending a dummy POST request using a Chrome extension to the same page and the content is reflected by what PHP returns. I have used the exact same URL as PayPal return URL and in my POST requests.
Any advice?

Paypal IPN - Getting + then losing data?

I am currently using the following library:
https://github.com/paypal/adaptiveaccounts-sdk-php/tree/master/samples/IPN
And Paypal IPN seems to be working fine... I can successfully checkout and all of the POST data from Paypal is logged to my server, only problem is - How do I check against it when the user is back on the site?
I currently have the return URL set to the same as the IPN url (look in github for code) and after I get all of the valid data, the user gets returned to the IPN page and it says invalid.
Not quite sure, any thoughts?
IPN should NOT be used as the return URL.
Return URL brings the buyer back to your site. The page at the return URL should display either a generic thank you page, or a page indicating the status of the buyer's order. Which one of the above to choose, depends on the PayPal product you select, your integration and your purchasing flow.
The script URL of the IPN listener is used to automate your order handling process. The IPN listener gets the IPN messages, processes your order in your own defined way.
IPN listener should post back very specific data to PayPal IPN endpoint with HTTP Status 200. If it also outputs a page, it makes things too complicated. You would need to differentiate between a buyer visit and a PayPal IPN message, and need to do corresponding display or IPN verification. To make things simple, separating the two things into two pages / scripts would be better and more logical.
I think this is the reason why your buyer gets "invalid": your IPN listener gets the request data when a buyer returns to your listener, and uses the data to verify IPN with PayPal. PayPal returns "invalid" as the data are not from valid IPN messages and thus cannot be verified.
Not a Php dev and haven't looked, but if you really want to use the same URL (I wouldn't - they serve different purposes), then the difference would be the (http) request method:
GET for a redirect and
POST for IPN
That would be one way you'd determine what kind of Request that url is getting and handle as you deem fit.

Authorize.net Get Transaction ID from Server Integration Method

I want to integrate my application with Authorize and I need to get the transaction ID to save this information in database. The question is, can I do this with SIM? I know you can set a URL to get back to you homepage, but is it possible to send the transaction ID back to homepage?
You have two options:
Relay Response
Relay Response is a feature available to merchants using Server Integration Method (SIM) or Simple Checkout. It instructs the payment gateway to return transaction results to the merchant using an HTML form POST to a specified URL on the merchant's Web server. A script or program at the URL can be used to create a custom receipt page using the transaction information. The custom receipt page is then relayed back to the customer's browser. Relay Response does not redirect the end user back to the merchant’s server, but relays the page content to the end user instead of displaying the Authorize.Net default receipt page.
Silent Post
This feature allows you to specify a URL, or Web address, to which the payment gateway should copy the transaction response that is sent to the configured Relay Response URL. If you are not using Relay Response, the feature allows you to specify an additional URL to which transaction responses can be posted.
If you're looking for sample PHP code I wrote an article that includes that here.
My recommendation is to use Relay Response as it gives you an opportunity to customize the receipt page your user's see. (Although you can use both as they do not conflict with each other).
(I am the author of both Silent Post articles)

$_POST from paypal response after payment is empty

I created a hosted button using a business account and integrated that code with my php application.
I use 'Website Payments Standard' and generated the 'Buy Now Button' using the tool provided in 'Merchant Services' page.
I am using http://sandbox.paypal.com/ to test this.
Configurations in Merchant Profile:
Instant Payment Notification (IPN) is
'Enabled' and 'Notification URL'
given.
Auto Return is On.
Return URL specified (the same given above in notification URL)
Payment Data Transfer is On
Website Payment is Off
PayPal Account Optional: is Off
While creating the button also in the third option I gave the same notify_url.
Transaction happens successfully and gets redirected to my notify_url.
The issue is, $_POST from paypal response in my notified page is empty.
I printed the $_POST in the first line of my notifier page itself. Do I need to add any other configuration? Am I making any mistake?
The data is going to the IPN url. Log the $_POST data to a file from the script at the IPN URL and see what you are getting. I think if you turn off the IPN, you may then get the data on the notify_url (been a while though, not 100% sure on that part).
the notify url is just for receiving the data from paypal about the transaction, it's not a webpage that you can display, because it doesn't happen inside the normal page flow, paypal simple opens a curl command (or similar) to your server and dumps all the data over $_POST
the return url is only used when the user clicks to return to your website.
so don't use the return url for recording the status of the payment, or sending emails, it'll fail badly, always use the notify url for doing that, the return url is just to show the user something pretty after he's paid, or not pretty if it failed

Categories