A payment token is required in order to continue the checkout process with Stripe payment plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 9 ans
Hello,

Anyone met with this issue when integrating with the Stripe plugin, v3.7?

I'm using the one here: https://www.nopcommerce.com/p/1974/payment-plugin-stripe-nop-paymentscom.aspx

Thanks!
Il y a 9 ans
Hello,

This may happen if you have installed a third party plugin that customizes the checkout flow, or if you have a template that has different CSS classes on the Submit button from the card details form. The error also happens, if you have an error in your JavaScript code (you can check by pressing F12 in chrome, and search the Console for errors).


You can try testing it with the default clean nopCommerce template, and see if that works.


Regards
Il y a 9 ans
Hello,

I do have a third party customized one page checkout integrated.

Where should I change to make it work? Is it the submit button css class?
Il y a 9 ans
I just tested, with the normal nopCommerce checkout steps, it works.

But we do need to integrate with customized One Single Page Checkout.
Il y a 9 ans
bradcwalker wrote:
I just tested, with the normal nopCommerce checkout steps, it works.

But we do need to integrate with customized One Single Page Checkout.



To make it work, it would require modification in the plugin, as well as in the Single Page Checkout... functionally speaking: when the user has entered his CC data, you need to make a call to Stripe, to generate the token - which is sent to the server. This is currently happening in the plugin, when the user clicks on "submit" (and the plugin uses the CSS class to identify the button), and after the token is generated, the submit flow is continued.

However, this flow is changed by the single page checkout, so you can imagine you need to get your hands in that code, as well as the javascript code from the PaymentInfo.cshtml file, from the Stripe plugin.
Il y a 9 ans
function GetScriptCallback() {
        Stripe.setPublishableKey('@ViewBag.PublicKey');
        ...

I see in my implementation, the @ViewBag.PublicKey is empty string, is it because I'm using the custom single one page checkout?
Il y a 9 ans
bradcwalker wrote:
function GetScriptCallback() {
        Stripe.setPublishableKey('@ViewBag.PublicKey');
        ...

I see in my implementation, the @ViewBag.PublicKey is empty string, is it because I'm using the custom single one page checkout?


In the normal NopCommerce checkout, you would not be able to reach that step, unless you have previously configured a non-empty PublicApiKey and PrivateApiKey (in the plugin's configuration page). So I guess you are seeing that empty, because you were able to select the Stripe payment method (due to one-page-checkout) without configuring the plugin
Il y a 9 ans
I have the plugin configured with secret and public keys in the admin area.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.