#Fredkzk
1 messages · Page 1 of 1 (latest)
👋 happy to help
yes you need to include it in all pages for security reasons https://stripe.com/docs/js/including
thanks, do you mind having a look at my javascript function (12 lines) then to see if it's alright?
coz right now it won't fire and I want to know if it's my setup or the function that's wrong
sure thing
var stripe = (function(inputs) {
var stripe = {};
var script = document.createElement('script');
script.src = 'https://js.stripe.com/v3/';
script.async = true;
document.body.appendChild(script);
script.onload = function() {
stripe.loaded = true;
var stripeInstance = Stripe(inputs.pk);
};
return error ? [1, {error}] : [0, {stripe}];
})(inputs);
(the 'inputs' is how I feed the publishableKey -pk var - to my function)
what instruction do you recommend then?
are you using vanilla js? or react?
well, I'm using a no-code framework that writes code in react native (under the hood, so no access) , the framework proposes building blocks and custom javascript
if you're using react-native you shouldn't be using Stripe.js
but the official stripe-react-native SDK
I cannot write anything in react native, it is done under the hood.
Isn't there a simple way to include the Stripe.js script on each page - with a js function?
we don't recommend using Webviews with Stripe.js in mobile applications
I would strongly advise you to change your strategy here since you're not going in the right direction
I'm 5 months in, with a no code framework. Not sure I can change that but is there another way then to enable cc payment , other than those two APIs that require stripe.JS?
you can use Checkout Sessions
sorry if you want a no-code solution then you can use Payment Links
ok thanks, in my no code environment, I can do any http requests to your APIs. I don't think I can use Checkout, can I?
maybe it's better to go with Payment Links
Indeed, I'm looking at it.
I'm selling e-vouchers at different prices, 5, 10, 15, 25, 49, 79$, etc.... So I'll need to create as many links I suppose
yes that's correct
thanks for your great support, as always.