Skip to content
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

Android custom card com.braintreepayments.api.exceptions.AuthorizationException for sandbox environment #100

Open
denisSmirnovDev opened this issue Sep 5, 2018 · 3 comments

Comments

@denisSmirnovDev
Copy link

After successful setup unable to get nonce for custom.

XPLATlient.setup(braintreeDemoToken)
.then(function (success) {
console.log('XPLATlient setup success', success);
})
.catch(function (err) {
console.log('XPLATlient setup err', err);
//error handling
});

const card = {
number: "4111111111111111",
expirationDate: "10/20", // or "10/2020" or any valid date
cvv: "400",
}

XPLATlient.getCardNonce(card)
.then(function (nonce) {
console.log('XPLATlient nonce', nonce);
})
.catch(function (err) {
console.log('XPLATlient err', err);
//error handling
});

In the react console nor success nor errors.
After debagging android code figured out that Braintree lib give exception:
com.braintreepayments.api.exceptions.AuthorizationException: You are unauthorized to perform input validation with these authentication credentials.

Debuger point on the:
@OverRide
public void failure(Exception exception) {
fragment.postCallback(exception);
fragment.sendAnalyticsEvent("card.nonce-failed");
}

Exception in postCallback from the BraintreeFragment.

@denisSmirnovDev
Copy link
Author

mArgument in that fragment: Bundle[{com.braintreepayments.api.EXTRA_INTEGRATION_TYPE=custom, com.braintreepayments.api.EXTRA_SESSION_ID=555b135dbbab4a12958a9037d3a492e8, com.braintreepayments.api.EXTRA_AUTHORIZATION_TOKEN=}]

@denisSmirnovDev
Copy link
Author

Found whats wrong.
Problem with validation.
In the Braintree.java (this library):

CardBuilder cardBuilder = new CardBuilder() .validate(true);

in the getCardNonce method
I set it to false and now working fine.
I hope it is help if somebody get same error.

Also the question It is related with sandbox environment?
Somebody had validation works with production environment?

@harleenarora
Copy link

I set to false
CardBuilder cardBuilder = new CardBuilder() .validate(false);

Still not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants