Skip to content

Loading…

Updating customer with wrongly formatted credit card returns AuthorizationError #14

Closed
nherment opened this Issue · 1 comment

2 participants

@nherment

Hi.

I'm sending this customer info:
{
"id":"myCustomerId",
"creditCard": {
"cvv":"111",
"number":"4009348888881881",
"credit_card_exp":"11/2013",
"cardholder":"Indiana Jones",
"options":{
"makeDefault":true,
"verifyCard":true,
"updateExistingToken":"9774s"
}
}
}

Per documentation, some attributes are misformatted:

  • credit_card_exp should be expirationDate
  • cardholder should be cardholderName

However, the BrainTree API then returns the following error:
{ message: 'Authorization Error', type: 'authorizationError' }

I'd expect the braintree API to return some specific error like 'unsupported attribute' but not an 'authorizationError' since the documentation on authorizationError is very misleading in this case:

You’ll receive an authorization exception if the API key that you’re using is not
authorized to perform the attempted action according to the roles assigned to the user
who owns the API key.

@agfor
Braintree member

Hi @nherment,

We check all parameters against those the user is allowed to set; therefore invalid parameters and disallowed parameters return the same error. We've noted this in our exception documentation, and it will be available next time we release the docs. Thanks for letting us know.

@agfor agfor closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.