Search code examples
phpjquerywordpresspayment-gatewayomnipay

Printing MIGS ( Mastercard Internet Gateway Service ) Successful payment response on the redirected page


I have a WordPress photo selling website where I have created password protected galleries. I send gallery password to specific users only. After entering the password they're able to buy any of the gallery image.

I'm using the MIGS ( Mastercard Internet Gateway Service ) in the site. Where user submits the form that includes amount to be paid. Upon entering the amount and clicking "Pay now" button we are sent to the mastercard payment site. Once the payment is successful user is redirected to the thank you page of the site.

Isn't there a way to not only redirect upon successful payment but also print response like "payment successful" in the thank you page?

I want something like this so that the links to download the images only shows up in the thank you page if the payment was successful.

If a payment is unsuccessful the user is redirected back to the checkout page with the response "Declined" in my site. But it does nothing except redirecting to the thank you page when a payment is successful. How will I know that the user is redirected from the payment site and the payment was successful? I want to have something like that in the thank you page.

Please help me guys!


Solution

  • Isn't there a way to not only redirect upon successful payment but also print response like "payment successful" in the thank you page?

    Isn't the thank you page on your site? Can't you add any text you like to that page?

    How will I know that the user is redirected from the payment site and the payment was successful? I want to have something like that in the thank you page.

    Usually when the payment completes and the user is redirected, you can make a completePurchase() (Omnipay call) to the gateway to confirm the purchase data. You should call supportsCompletePurchase() on the gateway first to determine whether it supports such a call.