Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • seanrock 262 posts 483 karma points
    Jul 22, 2020 @ 12:50
    seanrock
    0

    Display multiple payment forms

    Hi Matt

    I want to show multiple payment forms as we'll have multiple options, e.g. account (invoice), credit card and paypal.

    How do I render a form for all of the configured payment providers?

    Thanks Sean

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 22, 2020 @ 13:26
    Matt Brailsford
    0

    Hi Sean,

    I'm not quite sure what you mean?

    Generally the idea is you present the customer with the payment provider options, they choose one, then on the next screen you render the payment providers form which will send them to the relevant gateway.

    /Mat

  • seanrock 262 posts 483 karma points
    Jul 22, 2020 @ 13:35
    seanrock
    0

    Right. In our case we're not going to use an additional page to display what they've just chosen. So, given an example of 3 payment options, choosing any of them would send the customer off to the payment gateway. On the final page everything is displayed so there really is no need to show it again.

    I'm assuming the RenderPaymentForm will use the PaymentInfo from the order to call the selected provider? If that is the case then I cannot use that method because at this point (in the checkout) the user hasn't selected a payment method.

    If there were a RenderPaymentForm method that took a payment method name/sku and rendered for that specific method, that would be handy :)

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 22, 2020 @ 13:48
    Matt Brailsford
    100

    Ok, then in this case you may need to do some custom logic. There could be a few options.

    1) When they select a payment method, have that form submit to this next screen, but submit that into a hidden iframe which then renders the given form and auto submits it back to the main window.

    2) On selecting a payment method, make a javascript request to an alt template or similar that can render the given payment methods form and return it's code, then you replace the continue button witch the option.

    We can't really allow all buttons to be rendered at once as rendering the button usually involves communicating with the payment gateway and creating a session so you'd end up creating sessions for all the payment gateways whether you needed them or not.

    Option 1 would probably work best in this scenario as the payment provider form isn't generated until the continue button is clicked.

    I do need give this some though as I'm getting a lot of requests for needing to bypass the review step, but it needs to be done carefully so as not to create too many sessions.

    /Matt

  • seanrock 262 posts 483 karma points
    Jul 22, 2020 @ 13:51
    seanrock
    0

    Yes, 1 is the path i'm going down now.

Please Sign in or register to post replies

Write your reply to:

Draft