-
Notifications
You must be signed in to change notification settings - Fork 237
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
braintreeClient.deliverBrowserSwitchResult set the Activity intent to 'null' #634
Comments
@skauss thanks for using the Braintree SDK for Android. The browser switch happens internally in DropIn. We clear the intent to make sure a browser switch I'd like to know more about your use case. Is there a reason you need your own |
I need to do a setIntent in onNewIntent to get the intent to braintreeClient.deliverBrowserSwitchResult in onResume All data which start my activity are gone if the deliverResult do an activity.setIntent(null); The BrowserSwitchClient getResult (around line 160) check only the UrlScheme
To work only with scheme in not enough. In the old BrainTree client we have a succes and cancel path on the return path In your case you it would help if you reset the data Then all other data from the Activity survive an payment. Our use case |
For this I need a clientMetaId |
Hey @skauss I see your point. Setting the activity's |
We can figure out a separate fix for |
Hi @sshropshire |
I am looking forward for the clientMetadataId Fix :-) |
@sshropshire |
@skauss this is now available in version 4.23.0 of the Braintree SDK and version 6.6.0 of our DropIn SDK. I did draft a PR for adding a clientMetadataId accessor, but I would like to get some more testing done internally to make sure this is the best approach. In the meantime, you can use the following code snippet to extract the fun onDropInSuccess(dropInResult: DropInResult) {
val deviceDataJSON = JSONObject(dropInResult.deviceData)
val clientMetadataId = deviceDataJSON.getString("correlation_id")
} Let us know if this helps! |
@sshropshire To create a DropInClient I need an authorization or clientTokenProvider which I didn't have.
Or is there some pice of code which I didn't found. |
@skauss that's correct a ClientTokenProvider allows the SDK to fetch a client token on demand. This allows a |
@sshropshire In the flowchart "Our use case" in point #4 the JS Application ask me for an clientMetaId, which I can't deliver because I have no "<#CLIENT_AUTHORIZATION#>". In my client I have no problems to fetch the clientMetaId for PaypalVault or PayPalCheckout ( in this case I use BraintreeClient with an authorization I get from the JS Application). Just now for PayPalPlus (BrowserSwitch from my flowchart (PayPalPlus is our name for this payment flow)) I use an clientMetaId like this :
The BrowserSwitch is started this way :
Which work in the SandBox environment. Would this work also in production ? We need to deliver a new version of our app at the end of January to the Google Play Store. |
@skauss take a look at this doc for a reference on obtaining a client token. As for the |
@sshropshire In our scenario the Java App give a clientMetaDataId to the JavaScript payment application which do some magic stuff and than I get an callback to do a BrowserSwitch. In case of success I send an JavaScript event to our basket application with the clientMetaId. As I notice before in my sandbox environment I create an random string (UUID.randomUUID().toString()). This work in my BrainTree sandbox environment, will this be work also in the production environment ? |
Hi @skauss a random UUID may not work. I believe the UUID needs to match the one produced by the DropIn SDK. Also, the fix for this issue is now available if you upgrade to the latest 4.23.1 version. Can you file a separate issue for this in our DropIn repo? I'm going to close this one for now to mark it as done. |
Integration Details (please complete the following information):
Hi
I have to implement Braintree with browser switch.
Code to start the browser switch
To get the result intent
In onResume I check the BrowserSwitch result
Inside the BraintreeClient deliverBrowserSwitchResult line 123 the intent of the activity is set to null
The following code which checks the intent now is missing his information.
The BraintreeClient should only remove the intent data it needs.
The text was updated successfully, but these errors were encountered: