#Fredkzk

1 messages · Page 1 of 1 (latest)

solemn adderBOT
wraith bone
#

👋 happy to help

wintry fulcrum
#

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

wraith bone
#

sure thing

wintry fulcrum
#

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);

wraith bone
#

you shouldn't do that

#

at all

wintry fulcrum
#

(the 'inputs' is how I feed the publishableKey -pk var - to my function)

wintry fulcrum
wraith bone
#

are you using vanilla js? or react?

wintry fulcrum
#

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

wraith bone
#

if you're using react-native you shouldn't be using Stripe.js

#

but the official stripe-react-native SDK

wintry fulcrum
#

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?

wraith bone
#

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

wintry fulcrum
#

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?

wraith bone
#

you can use Checkout Sessions

#

sorry if you want a no-code solution then you can use Payment Links

wintry fulcrum
#

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?

wraith bone
#

maybe it's better to go with Payment Links

wintry fulcrum
#

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

wraith bone
#

yes that's correct

wintry fulcrum
#

thanks for your great support, as always.