triniwiz / triniwiz/nativescript-plugins
[android] EphemeralKeyProvider called 4 times
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 87
- Forks
- 57
- Avg merge
- 1h 36m
- Merged PRs (30d)
- 4
Description
Hi @triniwiz @NathanWalker
Sorry for reporting 3 separated issues but I discover then as i go!
I've seen 4 call to get the Ephemeral key! the problem come from com.stripe.android.CustomerSession.initCustomerSession that accept a 3rd attribute to avoid sending other request when PaymentSession is initialized. see here
We can expose an attribute at the constructor as below but strangely enough setting shouldPrefetchCustomer to false this does prevent the prefetech call but doesn't resolve the problem !! I'll investigate that more, I yhink the problem come from the PaymentSession !
Also Application.android.contextis deprecated for Utils.android.getApplicationContext()
export class StripeStandardCustomerSession {
constructor(shouldPrefetchEphemeralKey: boolean = false) {
StripeStandardConfig.shared.initPaymentConfiguration();
com.stripe.android.CustomerSession.initCustomerSession(StripeStandardCustomerSession.context, createKeyProvider(), shouldPrefetchEphemeralKey);
this.native = com.stripe.android.CustomerSession.getInstance();
}
static get context() {
return Utils.android.getApplicationContext();
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading StripeStandardCustomerSession and the calls to CustomerSession.initCustomerSession, PaymentSession, and createKeyProvider described in the issue. Reproduce or trace the four EphemeralKeyProvider calls, then verify the constructor option and Utils.android.getApplicationContext() behavior; done means the redundant requests and deprecated context usage are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, typescript
- Domain
- mobile, payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100