We're about to start implementing an integration with a payment provider that's not supported out of the box (Nets). This particular payment provider uses an external payment window, but apparently it does not support an explicit callback to our shop once payment is completed; instead the payment provider simply makes an automatic redirect to our receipt page (on which we're then forced to do a double check on the payment status etc.).
As I understand the article "Integrating with a Payment Gateway using External Payment Windows" on publicvoid.dk (http://www.publicvoid.dk/IntegratingWithAPaymentGatewayUsingExternalPaymentWindows.aspx), The PaymentProcessor needs to be invoked in order to update the order as authorized by the payment provider. Since we don't have the option to force our payment provider to call PaymentProcessor.axd, is there a way we can invoke the PaymentProcessor to have the payment status to be updated?
Are you sure that the callback is not supported? It would be the first time I come across a gateway that works like that. Might be it's async?
If indeed you never receive a callback you can, even though it's a little icky, invoke the ProcessCallback method of your payment method service manually on your confirm page.
You don't specifcally have to invoke the method via the PaymentProcessor.axd. It's just there to parse incoming callbacks/IPNs for you. In your case you'll have the page available and can parse the request yourself. Makes for a much simpler solution.
Something like this (ish); assuming payment reference is passed to you by the gateway:
// Proceed only if expected payment status if (payment.PaymentStatus.PaymentStatusId != (int)PaymentStatusCode.PendingAuthorization) throw new InvalidOperationException("Payment is not of expected payment status");
// Do validation of the received values, typically MD5 check, amounts, currency bool requestOk = ...;
if (requestOk) { payment.PaymentStatus = PaymentStatus.Get((int)PaymentStatusCode.Authorized); payment.Save();
var checkoutPipeline = PipelineFactory.Create<PurchaseOrder>("chechkout"); chechoutPipline.Execute(payment.PurchaseOrder); }
I'm baffled about the lack of automatic callback too, but apparently Nets does not support it. I'm in contact with their support now and until now they confirm that indeed an automatic callback is not supported.
Thank you for the code snippet - I'm sure it will come in handy if we actually proceed with Nets. But the lack of callback will probably mean that we'll convince the customer to switch to another provider (one that's already supported by uCommerce).
Sorry for the late reply, I've been vacationing... :)
We've been in touch with Nets support over the past weeks and it really is true - Nets relies solely on a redirect back to the shop, Nets do NOT support automatic callback.
For this reason we've decided to scrap Nets as provider.
I am also workin on "External Payment Gateway" using the "Innovate Payments" as the service provider. They have a provision for explicit "Call back Url".
As autocallback doesn't seem to be supported by my provider, what explicit Url should i be providing. Going through some examples i have come to know that it should be something like - "http://mysite.com/6/f417c364-de66-4a8a-9367-48a99d6dcbba/PaymentRequest.axd" where 6 stands for payment id & the later stands for the order id but this can be used in auto callbacks. Can i directly provide the call back url as "http://mysite.com/PaymentRequest.axd" to my service provider. Or as u have mentioned above a call back page wherein i should write the codes to perform the checks.?
I am already running tight with my project schedule.. Any quick help/response will be much appreciated.
Manually invoking the PaymentProcessor
Hi,
We're about to start implementing an integration with a payment provider that's not supported out of the box (Nets). This particular payment provider uses an external payment window, but apparently it does not support an explicit callback to our shop once payment is completed; instead the payment provider simply makes an automatic redirect to our receipt page (on which we're then forced to do a double check on the payment status etc.).
As I understand the article "Integrating with a Payment Gateway using External Payment Windows" on publicvoid.dk (http://www.publicvoid.dk/IntegratingWithAPaymentGatewayUsingExternalPaymentWindows.aspx), The PaymentProcessor needs to be invoked in order to update the order as authorized by the payment provider. Since we don't have the option to force our payment provider to call PaymentProcessor.axd, is there a way we can invoke the PaymentProcessor to have the payment status to be updated?
Regards,
Kenn
Uhm... anyone...?
Hi Kenn,
Are you sure that the callback is not supported? It would be the first time I come across a gateway that works like that. Might be it's async?
If indeed you never receive a callback you can, even though it's a little icky, invoke the ProcessCallback method of your payment method service manually on your confirm page.
You don't specifcally have to invoke the method via the PaymentProcessor.axd. It's just there to parse incoming callbacks/IPNs for you. In your case you'll have the page available and can parse the request yourself. Makes for a much simpler solution.
Something like this (ish); assuming payment reference is passed to you by the gateway:
Thanks Søren,
I'm baffled about the lack of automatic callback too, but apparently Nets does not support it. I'm in contact with their support now and until now they confirm that indeed an automatic callback is not supported.
Thank you for the code snippet - I'm sure it will come in handy if we actually proceed with Nets. But the lack of callback will probably mean that we'll convince the customer to switch to another provider (one that's already supported by uCommerce).
Cheers,
Kenn
Any further developments on this? I'm very interested in finding out whether they truly don't support callback.
Hi Søren,
Sorry for the late reply, I've been vacationing... :)
We've been in touch with Nets support over the past weeks and it really is true - Nets relies solely on a redirect back to the shop, Nets do NOT support automatic callback.
For this reason we've decided to scrap Nets as provider.
Thanks for your help!
Kenn
Hi Soren,
I am also workin on "External Payment Gateway" using the "Innovate Payments" as the service provider. They have a provision for explicit "Call back Url".
As autocallback doesn't seem to be supported by my provider, what explicit Url should i be providing. Going through some examples i have come to know that it should be something like - "http://mysite.com/6/f417c364-de66-4a8a-9367-48a99d6dcbba/PaymentRequest.axd" where 6 stands for payment id & the later stands for the order id but this can be used in auto callbacks. Can i directly provide the call back url as "http://mysite.com/PaymentRequest.axd" to my service provider. Or as u have mentioned above a call back page wherein i should write the codes to perform the checks.?
I am already running tight with my project schedule.. Any quick help/response will be much appreciated.
Many thanks.
Balbir
any one.. ?
is working on a reply...