#negative10xprogrammer
1 messages · Page 1 of 1 (latest)
Can you share more details about your integration ?
Can you share a PaymentIntent Id ?
this is the code I have :
CheckoutForm.js
import React from 'react';
import { PaymentElement } from '@stripe/react-stripe-js';
const CheckoutForm = () => {
return (
<form>
<PaymentElement />
<button>Submit</button>
</form>
);
};
export default CheckoutForm;
and index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Elements } from '@stripe/react-stripe-js';
import { loadStripe } from '@stripe/stripe-js';
import CheckoutForm from './CheckoutForm';
// Make sure to call `loadStripe` outside of a component’s render to avoid
// recreating the `Stripe` object on every render.
const stripePromise = loadStripe('pk_test_51N0LqFK8v32HmraZlMkljiLm2bJY4aj5oNreVbAK6m9w3BpoWlUCAIkLUWEhUtYg0ucw90zvIh4EqVq5KEI8yJC3007HkfI3sM');
function App() {
const options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
// Fully customizable with appearance API.
appearance: {/*...*/ },
};
return (
<Elements stripe={stripePromise} options={options}>
<CheckoutForm />
</Elements>
);
};
ReactDOM.render(<App />, document.getElementById('root'));
Can you share a screenshot of this output
'
yes ok so i turned on klarna, but it doesnt show up yet
surely it goes off the api key?
it's the publishable key, no?
acct_1N0LqFK8v32HmraZ
Your account is based is Sweden, use eur currency.
oh lol, thanks man
just one question
why doesnt sweden show up as an alternative when i select country in the klarna menu?
What Klarna menu ? is this in Stripe Dashboard? can you share a screenshot ?
ah it's because i changedto eur
so i'm guessing that currency should nto be a hard coded value
but rather the users preference upon entering the site
Sorry, I'm not sure I understand your latest messages .
no problem. I just have two more questions:
if I pick usd, why isn't klarna showing up when it says
Supported currencies AUD, CAD, CHF, CZK, EUR, GBP, DKK, NOK, NZD, PLN, SEK, USD
Second... how do i turn off payments? i turned some on but there doesnt seem to be an off button lol
for example for cartes bancaires
if I pick usd, why isn't klarna showing up when it says
Supported currencies AUD, CAD, CHF, CZK, EUR, GBP, DKK, NOK, NZD, PLN, SEK, USD
That's depending on your account location and account currency also:
https://stripe.com/docs/payments/klarna
In order to accept USD with Klarna your account need to be in US
Second... how do i turn off payments? i turned some on but there doesnt seem to be an off button lol
for example for cartes bancaires
You can't disable credit card from the dashboard
If you want to remove cards from the element, you can force the element to use specific PaymentMethods by setting paymentMethodTypes
https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodTypes