I have created a Stripe payment option and added the code (from Github) onto a payment page, but get this error:
(index):1 Uncaught IntegrationError: Please call Stripe() with your publishable key. You used an empty string.
at new t (https://js.stripe.com/v3/:1:10589)
at new e (https://js.stripe.com/v3/:1:114612)
at ss (https://js.stripe.com/v3/:1:122178)
The source of the error is:
// Create a Stripe client.
var stripe = Stripe('');
However, in the code it is:
// Create a Stripe client.
var stripe = Stripe('@Request.Form["api_key"]');
So why is the form variable blank? What am I missing?! (I need another coffee!!)
I have configured both the test and live keys and the gateway is currently set to "test".
The Request.Form["api_key"] should get populated with either the test_public_key or live_public_key depending on what mode the payment provider is configured in.
Oh dear, I'm sure it's supposed to be easier than this!
The page was not working because I had accessed it directly, and now I remember why ... because when I go from the "Accept and Pay" page via the GeneratePaymentForm button, I get this error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /en/store/cart-content/payment/
However, the URL most definitely exists! So it must be something else?
Error using Stripe Gateway
I have created a Stripe payment option and added the code (from Github) onto a payment page, but get this error:
The source of the error is:
However, in the code it is:
So why is the form variable blank? What am I missing?! (I need another coffee!!)
I have configured both the test and live keys and the gateway is currently set to "test".
The
Request.Form["api_key"]
should get populated with either thetest_public_key
orlive_public_key
depending on what mode the payment provider is configured in.https://github.com/TeaCommerce/Payment-Providers/blob/master/Source/TeaCommerce.PaymentProviders/Inline/BaseStripeProvider.cs#L61
Do you have the
test_public_key
filled in for the payment provider?Also, you need to have gotten to your payment form page having clicked a button wrapped in the
GeneratePaymentForm
callhttps://docs.teacommerce.net/3.3.0/api/payment-forms/#generatepaymentform
Oh dear, I'm sure it's supposed to be easier than this!
The page was not working because I had accessed it directly, and now I remember why ... because when I go from the "Accept and Pay" page via the GeneratePaymentForm button, I get this error:
However, the URL most definitely exists! So it must be something else?
OK, found the problem - me being forgetful (not creating a controller action)!
If that's an Umbraco page, it shouldn't require a controller action? Unless this is specific to how you setup your install?
is working on a reply...