Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using service.finalizeOrderIfNeeded(); with hosted page payment #604

Closed
catokx opened this issue Jun 5, 2019 · 6 comments
Closed
Labels

Comments

@catokx
Copy link

catokx commented Jun 5, 2019

Good morning, i need to use some code in custom checkout sdk "after" successful payment in external payment gateway hosted page. Following the documentation https://github.com/bigcommerce/checkout-sdk-js#finalize-order i call the await service.finalizeOrderIfNeeded(); and after this i need to call some js before redirecting to the order confirmation page.
In most cases the redirection to the order confirmation page is done directly by the sdk, not the code in my custom checkout page, in fact in the integration panel of bigcommerce the gateway redirection page is payments.bigcommerce.com/... and cannot be changed.

Sometimes it works but i think it is only a failover behaivoir

@davidchin
Copy link
Contributor

Hi @catokx, can you tell me which hosted payment method you're using?

@catokx
Copy link
Author

catokx commented Jun 7, 2019 via email

@davidchin
Copy link
Contributor

Ah yes, for some payment methods, i.e.: Adyen, shoppers are directly redirected to the order confirmation page after a successful payment. Therefore, finalizeOrderIfNeeded is not necessary for these payment methods. We should probably update the documentation so it's clearer for everyone. :)

@fthobe
Copy link

fthobe commented Jun 7, 2019

Hi @davidchin , we just wasted one month of trial and error and endless emails with bigcommerce customer support. We don’t share your sense of emoji humour on this one. Will this ever be fixed or is it contemplated to implement payment forms for Adyen?

@davidchin
Copy link
Contributor

Hi @fthobe, I'm really sorry to hear that. And we apologise for not able to unblock you earlier.

As I mentioned in my last comment, for certain hosted payment methods such as Adyen, the order finalisation call is triggered directly on the server side. If the call is successful, shoppers will be redirected to the order confirmation page. As they have completed the checkout process, there's little point redirecting them to the checkout page again as their shopping cart is already converted into an order and there's nothing further for them to do. finalizeOrderIfNeeded method is only required for some payment methods that don't trigger the finalisation call directly on the server side. This is why I said the current documentation might not be clear enough and we should clarify the intended behaviour of various hosted payment flows we support.

Anyway, I guess this issue is related to #606. How about we continue our discussion there? It seems to me that the reason you're asking about the Adyen payment flow is that you want to trigger some GA tracking calls?

@fthobe
Copy link

fthobe commented Jul 2, 2019

Hi @davidchin, yes! We have reverted to the order confirmation page and it seems to work fine given that we can track there also the payment. BC support was very helpful on getting this up and running. If you create an empty repository with us we can fill it up with a tracking code example to implement google conversion tracking on the thank you page.

@catokx catokx closed this as completed Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants