Score:1

Redirect directly to the payment provider page

ca flag

I'm building a store with Drupal Commerce and creating my own off-site payment gateway. On the review page, after selecting payment method, the user can click the button to pay and finish the order. After that he's redirected to a page that tells him to wait to be redirected to the payment provider.

Is there a way to redirect the user to the payment provider without needing to go to this useless page ?

Thank you.

Alireza Tabatabaeian avatar
cn flag
actually this is not a useless page, this page is in charge of building a from with hidden values which then submission of this form will cause redirecting to offsite payment along sending required information, in most cases a javascript will cause auto redirecting on page ready so it wont make much bother
Leeroy avatar
ca flag
I think this page is useless as for the customer it serve no purpose, the url redirect should be done in the back and only show the payment page to the customer.
Score:0
ca flag

If you already have a redirect link and doensn't need a page to have hidden values in a form, you can use the self::REDIRECT_GET instead of self::REDIRECT_POST in the buildConfigurationForm function of your payment method.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.