Stripe V3 checkout--refreshing the page duplciates order

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
3 years 8 months ago #322566

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.3

We purchased the V3 stripe plugin and I wanted to test it before moving away from AIM. I realize that this method doesn't allow for us to enter the credit card information as part of the order form, and thus the order is created before the payment process is initiated.

But on a test site, with no other payment plugins installed, if the visitor refreshes the payment page--for whatever reason (I was re-attempt a failed test payment) a new order is created.

Is there any way to prevent this from happening?

Does the order checkout process have to leave the order page to process the payment--in other words, can the stripe payment process pop-up on the last page when submitted and if cancelled, stay on the page or if successful, proceed to confirming the order?

I have tried placing "return url" and "cancel url" on the payment plugin configuration, but these don't appear anywhere on the payment page. Is there a way we can have links for the customer to cancel the payment process and return to the order (such as wanting to switch to another payment method)?

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
3 years 8 months ago #322576

Hello,

Credit card details in the payment form is part of current developments for the plugin.
More precisely, it's part of current testing since there is no details regarding the restrictions and limitations of the "payment intent" system of Stripe
So, in order to reduce the customers' problems, we used the HikaShop "end page" system which is used by a big part of the payment plugins such as "paypal".

When a payment plugin require an order number, HikaShop must create the order before displaying the payment page to the customer.
It means that the order is created and an email can be sent to the customer for that order creation.
Using Stripe V3 in "end" mode is like using "Paypal", it requires the same kind of configuration.
With all that kind of plugin, a new order is created each time you want to attempt a payment ; if you refresh the page or re-complete the last step of the checkout.

The "return url" is used when an order is completed and the "cancel url" is where the customer will be redirected after the call of the HikaShop payment cancel URL.
It could be possible to add a link to cancel the transaction in the payment page ; thus the customer will cancel the created order and be redirected to the configured URL.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
3 years 8 months ago #322577

If you need another test candidate, please let me know.

In the mean time we have to make the page display more information to help make the process more intuitive to the visitor.

I know I can add modules dependent on the Joomla page (ctrl=checkout&task=confirm and our Itemid), and the checkout/end.php can be overridden, but can we control the elements customization as well somewhere?

I was also hoping to add the javascript to enable Apple Pay/Google Pay for mobile devices. Do we just modify the stripeconnect_end.php directly or is the a J! override path?

Thanks for your patience! (also, I'm curious...this is the 2nd plugin I've purchased from the HS marketplace--but there is no update path when things our outside of the J! nomenclature--how do we get updates or know if there is one available?)

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
3 years 8 months ago #322637

Hello,

Thank you ; we will really think about releasing a beta for that checkout integration even if we still don't have information regarding the API limitations.

You can customize the stripeconnect_end page like other HikaShop payment plugin views :
www.hikashop.com/forum/checkout/895625-w...pal-page.html#297769

Regarding the update notification with the marketplace ; I need to talk with the rest of the HikaShop team in order to know more about what will come.
For the moment, a version number is displayed in the product page but I agree that it would be cool to have an integration with the updatexml system.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 116
  • Thank you received: 7
  • Hikashop Business
3 years 7 months ago #323279

Thanks, I couldn't find anything using the view files option. That helps.

Looking at the stripeconnect_end page I am thinking about adding a script on the page, can you give me your opinion?

window.onbeforeunload = function() { 
    window.setTimeout(function () { 
        window.location = '/my-account'; //someplace other than the same page
    }, 0); 
    window.onbeforeunload = null; // kill loop
}
The idea is if someone gets to the checkout/after_end, if they try to refresh the page instead of creating a duplicate order (which really doesn't make sense), it will redirect them...in this example the alias /my-account is just Hika's user control panel.

I also notice that there is a cancel url and a return url. I see that the return url works after payment is made, but I don't see where cancel url is of use--there isn't a way to cancel the payment request after you read the end of HIka's checkout process. Am I missing something?

Thanks!

EDIT: never mind, it works to get the visitor off the page, but it still creates one duplicate order. I don't suppose anyone knows of a way to keep this from happening?

Last edit: 3 years 7 months ago by Jerome. Reason: [code] tag is nice

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
3 years 7 months ago #323309

Hello,

The cancel url is not really used by the plugin since the payment error is directly display in the "end" page and the customer can try again (without creating a new order).

In order to avoid the order duplication for the same cart, one solution would be in the HIkaShop core so the confirmation of the cart will use a previously created order which is still "created" ; which would mean that the customer refreshed the page without performing a payment (successfully or not).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum