简体   繁体   中英

How can I change the apiVersion of the Ephemeral Key Provider in Stripe?

I want to create EphemeralKey for my Stripe payment service and I cannot modify the apiVersion of the Stripe.

In my Stripe Dashboard the default apiVersion is 2019-3-14 , but in the Android library keeps the old api Version which is 2017-06-05 . But, it doesn't allow me to modify the value in the ApiVersion.java in Stripe Library. How can I override the EphemeralKeyListener in order to avoid retrieve the old value?

My code was based on the official examples of Stripe for the SampleStore.

I expect to retrieve the ephemeral key after the rest call the backend server.

It's not possible to change this — the stripe-android SDK makes requests directly to the Stripe API, using the ephemeral key you provide. Those requests must be pinned to a particular version, since the code in the SDK has to be written to work with a specific version(regardless of the version that a user of the SDK might be using) to work properly.

I'm not sure why you want to change the API version used by the SDK — the code in each version of the SDK will only work with the API version it's designed for. Usually you'd just upgrade the SDK itself if there'a specific reason you need to use a more recent API version, but it's not generally required(and it's not a problem if your default version is different from what the SDK uses).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM