PaymentMethodType.Standard and PaymentMethodType.Redirection change after checkout?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi guys,

I'm integrating into new payment system, which has process flow where if card supports 3DS payment it will do redirect, if card doesnt support 3DS it will do straight charge.

Now my question, is how can I support such proecss in nopCommerce, since as I understand the process flow in nopCommerce works of what i return in IPaymentMethod.PaymentMethodType? can I change from Standard to Redirection at runtime? If yes, then can I get hint on how i can accomplish it?

Regards, Dmitri
6 years ago
Having a similar issue with a 3DS form that needs redirecting, but I am using the OnePageCheckout package and it just goes to a blank page instead of redirecting to the 3DS form.

Any help would be greatly appreciated.

Snippet:

public ActionResult ThreeDConfirm(FormCollection form)
{
    return base.View("ThreeDConfirm");
}
6 years ago
Dmitri

While I'm pretty sure one could return a different PaymentMethodType depending on certain options, it would depend on whether nopcommerce reads it at the right time so imo it's probably not feasible.

I will say that I have had a similar but different problem recently. Perhaps it could give you an idea of how to proceed.

So the payment method I was implementing brings up a popup/overlay. The user signs in to the payment methods wallet and accepts the purchase. When done it redirects to a specific (pre-provided) page with the results for the server to go and capture the charge.

My solution:

1. PaymentMethodType is Standard
2. In the controller I have the action that gets called from the payments redirect at the end
3. This action does some processing (creates an authorisation charge)
4. Does the processing of CheckoutController.EnterPaymentInfo() and redirects to the confirmorderpage
5. Upon the confirm button being clicked, in the plugin's ProcessPayment method I capture the charge and mark as paid

Some comments though:
1. Nopcommerce cookies need to be persisted back to nopcommerce on the redirect otherwise you will end up with a workcontext.currentcustomer that is a new guest without any items in the cart
2. Regarding number 4 above, I had to copy the EnterPaymentInfo method to the plugin controller and call it locally rather than post data to its web address. This ensured that the HttpContext.Session where the data was saved to, is the same Session that the CheckoutController.ConfirmOrder route is the same.
3. I had previously tried creating a HttpClient and doing a POST the PaymentInfo web address, however there were 2 problems. Ones is that I needed to manually set the required cookies and number 2 is that the Session used was a whole new one so the info saved did not get persisted to the ConfirmORder route. That meant it would go back to the paymentinfo route rather than commit the order

I believe if you implement as similar to mine, your biggest problem would be that the 3DS redirection would need to somehow store the nopcommerce cookies and make sure that upon redirecting back into your controller it sets those cookies and/or you can manage to restore the cookies so that the _workContext.CurrentCustomer is correct

Hope that helps. Ask if you need more details
6 years ago
Thank you Chris. I will investigate your solution.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.