#thedarthjosh
1 messages · Page 1 of 1 (latest)
You can set it per request ^
Or change your account's default
Yea I know that, but there's nowhere in the test dashboard to change it globally, and the package thats integrated (before I joined the company) doesnt reference it anywhere
You only want to change it for test mode?
I want to test it in test mode before moving it to production
I looked in the package we're using, and all I see is that its loading the checkout.js
Then the recommended way to do that is to set it in the sdk specifically
I was afraid of that 😦
You can set it globally for the sdk: https://stripe.com/docs/libraries/set-version#setting-the-api-version
I saw, was just hoping for a turnkey instead of a re-write.
If we're loading just the js file remotely, does that automatically go to the next versions?
loading the source code it has a references to /v3 on some calls
I think the calls made through stripe.js will be the latest, but API version is mostly relevant for your server-side calls
That's what api version changes behavior for largely
Ok. We're just using the checkout part, and no headers set, but we have most calls with 2018-02-28, a few with 2020-08-27, and 0 with 2022-11-15
Yes, we have a few packages, they put in their name/cc info, and it processes with a succes/fail
we use hosted pages for a few products but they wont be affected
Well if you're creating sessions server-side, you'll need to update api version in your server side sdk
I would think that anything in the prod environment could be tested in the test environment
We just use the react library
and just checkout, not an IPN or anything
Can you share a code snippet of you creating a checkout session?
import React from 'react';
import StripeCheckout from 'react-stripe-checkout';
import * as zenApi from '../../generics/zenApi';
const CURRENCY = 'USD';
const PAYMENT_SERVER_URL = process.env.API_URL + '/billings';
const successPayment = data => {
alert('Payment Successful:- ' + data);
};
const errorPayment = data => {
alert('Payment Error:- ' + data);
};
const onToken = (amount, description) => token =>
zenApi.post(PAYMENT_SERVER_URL,
{
description,
source : token.id,
currency: CURRENCY,
amount : amount
})
.then(successPayment)
.catch(errorPayment);
const Checkout = ({ name, description, amount, pub_key }) =>
<StripeCheckout
name={name}
description={description}
amount={amount}
stripeKey={pub_key}
token={onToken(amount, description)}
currency={CURRENCY}
/>;
export default Checkout;
Thats the only place that loads react-stripe-checkout
Oh
Which we installed from
https://www.npmjs.com/package/react-stripe-checkout
Easily inject checkout.js as a react component. Will load the script on demand and supports all the options from stripe docs.. Latest version: 2.6.3, last published: 6 years ago. Start using react-stripe-checkout in your project by running npm i react-stripe-checkout. There are 37 other projects in the npm registry using react-stripe-checkout.
That's a third party library
Yea
Yeah that's not maintained by Stripe, so we can't support it in here unfortunately. I'm not sure how to set API version within their library
So thats why I was asking if we could upgrade the API in the test dashboard and see if it works
No only in live mode
Testing api version upgrades are supposed to be done on a per request basis with the sdk
But that's not our sdk
So you will either have to reach out to its developer or look into their open source code to figure out how
Yea I wasnt expecting support on that, it was more on the stripe side as far as the test dashboard
Right. But shouldnt it be? I would think test would be a mirror of prod, so people can test before deploys
You can reach out to support with that feature request if you like: https://support.stripe.com. Currently that's just not how it works. API version is account-wide (both test and live)
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Ok, will do. Thanks!