-
Notifications
You must be signed in to change notification settings - Fork 300
[Draft] Crypto Onramp SDK bindings #2097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
carlosmuvi-stripe
wants to merge
112
commits into
master
Choose a base branch
from
beta/crypto-onramp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 95 commits
Commits
Show all changes
112 commits
Select commit
Hold shift + click to select a range
96a9b53
Configuring successfully so far
Twigz b0f1483
Adds in registering crypto user
Twigz 357b001
Additional compilation for registerWallet and collectKYC
Twigz e637349
No more error when trying to use the presenter, but not presenting yet
Twigz 61fe94f
Example iOS configure implementation
Twigz c5de756
Fixing android side of things
Twigz a4352ff
Merge branch 'master' into twigz/onramp-rn-bridge
Twigz bcb1287
Functioning identity and payment selection
Twigz da3a2b9
Update coloring to be a string
Twigz 10248d5
Update HomeScreen.tsx
Twigz e7e37b7
At least sometimes display the payment image
Twigz 67b7c55
Added bank account button
Twigz afcf4e0
Adds in registering a wallet UI
Twigz 1e49365
Fix string
Twigz 5bfb074
Updates Stripe SDK to 24.21.0 and adds CryptoOnramp
Twigz b4616bd
Adds createCryptoPaymentToken api
Twigz 0273ee1
Modeled perform checkout as if the clientSecret was just a string
Twigz 8521b27
Merge branch 'twigz/update-stripe-ios-pod' into twigz/onramp-rn-bridge
Twigz 97b7ee9
Wrap the collapsible in a StripeProvider
Twigz 5c42c23
Updates the actual Android released version
Twigz f8cc15c
Stop creating a map for the isLinkUser response
Twigz 1a9a356
Adds in emitting results for authorize and checkout callbacks
Twigz 53a15c5
Adds in missing authorize call
Twigz e9f2361
handle through a promise instead of a listener
Twigz 52b445e
Update to use promises with types
Twigz bcd0e9a
Remove unnecessary emitters
Twigz d6ec796
No need to return a map anymore
Twigz f85396a
Remove unnecessary type declarations
Twigz bb25388
update api naming
Twigz 3f0fa5d
Rename collectPaymentMethod
Twigz 7bdf61b
Add in code for checkout
Twigz eb3d15c
Implements first 5 iOS CryptoOnrampCoordinator methods
mliberatore 67f3e08
Merge branch 'twigz/onramp-rn-bridge' of https://github.com/stripe/st…
mliberatore da97041
Implements onrampAuthorize
Twigz 38275af
Implements attachKycInfo on iOS
mliberatore 605d878
Implements createCryptoPaymentToken on iOS
mliberatore 310d2d7
Minor refactor to reduce duplication around finding presenting view c…
mliberatore 25530a2
Implements verifyIdentity on iOS
mliberatore 056ddc5
Update build.gradle
Twigz c73b182
Moves view controller access out of Tasks
mliberatore 4000bca
Merge branch 'twigz/onramp-rn-bridge' of https://github.com/stripe/st…
mliberatore 67a5f76
Implements collectPaymentMethod on iOS
mliberatore 3b4b55c
Adds in ui for creating a crypto payment token
Twigz 223f0b6
Button for authorization, need LAI inserted
Twigz c135fb9
View controller access was still on a background thread (the RN bindi…
mliberatore 10a4eae
Renames provideCheckoutClientSecret parameter
mliberatore e72cda8
Implements performCheckout on iOS
mliberatore 7d9b944
Add in kyc attachment ui for testing
Twigz 26eed25
Adds in the api for updating phone number
Twigz 6fd3790
Adds Apple Pay support on iOS
mliberatore b4bfc24
Merge branch 'twigz/onramp-rn-bridge' of https://github.com/stripe/st…
mliberatore 93a57e1
Removes unneeded structures surrounding single return values
mliberatore 32bd009
zeros out kyc ssn
mliberatore b8ad64d
Propagates errors appropriately for kycInfo collection on iOS
mliberatore b21e84a
fix android build
lng-stripe b7d1ee8
Updates iOS SDK to latest
mliberatore cfdea91
Implements onrampAuthorize on iOS
mliberatore 7fabe47
Adds test UI for onrampAuthorize
mliberatore f2218f8
Silences warning in unimplemented updatePhoneNumber on iOS
mliberatore 49479e4
Update CryptoOnrampScreen.tsx
Twigz e70f290
Merge branch 'twigz/onramp-rn-bridge' of https://github.com/stripe/st…
Twigz cc32109
propagate configuration result
lng-stripe f0526dd
adds unimplemented logout api
Twigz 98451ea
Merge branch 'twigz/onramp-rn-bridge' of https://github.com/stripe/st…
Twigz 5133bfd
Uses appropriate emitter on iOS for checkout
mliberatore 5f78069
Gets Check Out working in example; removes duplicate Authorize UI
mliberatore fbc9da3
Change emitting to use existing invocation
Twigz b5e38e9
Adds `StripeProvider` with publishableKey and merchantIdentifier for …
mliberatore 5dd3e5a
Merge branch 'twigz/onramp-rn-bridge' of https://github.com/stripe/st…
mliberatore 0b3c3ac
Silences warning in unimplemented API on iOS
mliberatore c492019
move functions to useOnramp() hook
lng-stripe 9f703cd
refactor: move LinkUserInfo type to Onramp.ts and update imports
lng-stripe 618e659
refactor: consolidate CryptoNetwork and KycInfo types in Onramp.ts
lng-stripe 82db96e
rm idtype and kycinfo fields
lng-stripe 58970cc
rm "onramp" from useOnramp() functions
lng-stripe fab4192
add OnrampConfiguration; cleanup defaults
lng-stripe cdadf9c
Switch iOS impl to use resolver instead of rejector in error cases
mats-stripe 8cfbab9
Update example app to use new error handling pattern
mats-stripe 23d1aac
inline for simplicity
lng-stripe b039846
update types
lng-stripe 40ec1d5
fix codegen
lng-stripe fab6079
Use VoidResult type for remaining APIs on iOS
mats-stripe 6e05bc6
update configureOnramp()
lng-stripe 496baa1
update hasLinkAccount
lng-stripe 872f13c
fix registerWalletAddress and registerLinkUser
lng-stripe b9f882f
fix rest of Android Onramp; update AuthorizeResult
lng-stripe cd51e12
Fix AuthorizeResult shape on iOS impl
mats-stripe cf32fee
fix handleOnrampAuthenticationResult
lng-stripe b65f09c
alert configuration success
lng-stripe 117c0b9
set version
lng-stripe 9e520de
improve demo UI
lng-stripe d2f1ee8
defaults
lng-stripe f13e645
more UI cleanup
lng-stripe f044a8f
Makes appearance specification more permissive on iOS in the case of …
mliberatore 626ef85
[onramp][private-beta] Conditionally include Onramp; fixes & improvem…
lng-stripe c46aeef
logOut Android binding (#2098)
lng-stripe 2b9051c
Merge remote-tracking branch 'origin/master' into beta/crypto-onramp
carlosmuvi-stripe 1ca77a1
add update phone number example UX (#2100)
lng-stripe eb6912f
[Onramp] Bumps native versions (#2101)
carlosmuvi-stripe 194c847
[Onramp] Implements Remaining Bindings for StripeCryptoOnramp on iOS …
mliberatore 88a1ff4
fix: add missing await to NativeStripeSdk.initialise calls (#2113) (#…
lng-stripe feb04b4
Crypto Onramp Example Cleanup (#2106)
Twigz e718aca
Crypto Onramp Example Refactoring (#2126)
Twigz 130ac95
[onramp] Configure with crypto customer ID (#2138)
lng-stripe ffde7d6
Crypto Onramp Payment Display Data (#2132)
Twigz 7da784d
Revert "Use files instead of npmignore to cleanup npm package (#2081)…
porter-stripe b4aaa5d
Update package.json (#2105)
porter-stripe f905dad
Bump version number to 0.52.0-crypto-onramp-2-private-beta
gbirch-stripe 4848f86
fix current version
lng-stripe 96a771e
bump 0.52.0-crypto-onramp-2-private-beta.1
lng-stripe a588e9d
Update NativeOnrampSdkModuleSpec.java (#2141)
Twigz dd847e3
bump 0.52.0-crypto-onramp-2-private-beta.2
lng-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| package com.reactnativestripesdk | ||
|
|
||
| import com.facebook.react.bridge.Promise | ||
| import com.facebook.react.bridge.ReactApplicationContext | ||
| import com.facebook.react.bridge.ReactMethod | ||
| import com.facebook.react.bridge.ReadableMap | ||
| import com.facebook.react.module.annotations.ReactModule | ||
| import com.reactnativestripesdk.utils.createFailedError | ||
|
|
||
| @ReactModule(name = NativeOnrampSdkModuleSpec.NAME) | ||
| class FakeOnrampSdkModule( | ||
| reactContext: ReactApplicationContext, | ||
| ) : NativeOnrampSdkModuleSpec(reactContext) { | ||
| @ReactMethod | ||
| override fun initialise( | ||
| params: ReadableMap?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolve(null) | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun configureOnramp( | ||
| config: ReadableMap?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun hasLinkAccount( | ||
| email: String?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun registerLinkUser( | ||
| info: ReadableMap?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun registerWalletAddress( | ||
| walletAddress: String?, | ||
| network: String?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun attachKycInfo( | ||
| kycInfo: ReadableMap?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun updatePhoneNumber( | ||
| phone: String?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun authenticateUser(promise: Promise?) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun verifyIdentity(promise: Promise?) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun collectPaymentMethod( | ||
| paymentMethod: String?, | ||
| platformPayParams: ReadableMap?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun provideCheckoutClientSecret(clientSecret: String?) { | ||
| // No-op | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun createCryptoPaymentToken(promise: Promise?) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun performCheckout( | ||
| onrampSessionId: String?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun onrampAuthorize( | ||
| linkAuthIntentId: String?, | ||
| promise: Promise?, | ||
| ) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| @ReactMethod | ||
| override fun logout(promise: Promise?) { | ||
| promise?.resolveNotImplemented() | ||
| } | ||
|
|
||
| private fun Promise.resolveNotImplemented() { | ||
| this.resolve( | ||
| createFailedError( | ||
| NotImplementedError( | ||
| "To enable Onramp, add 'StripeSdk_includeOnramp=true' to gradle.properties.", | ||
| ), | ||
| ), | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should point to.
21.26.0here once released.