braintreebraintree-sandbox

Sudden Failure Requests on Braintree Sandbox API: 'Billing state format is invalid'


We're running a UK Magento store hooked up to Braintree. All has been running smoothly for months, then suddenly, we are no longer able to complete an order on any of our staging or local test environments which are hooked up to Braintree Sandbox.

At checkout, a request is made to the 3d secure endpoint, and if we have entered a UK based county, we get the following response:

Endpoint: https://api.sandbox.braintreegateway.com/merchants/xxx/client_api/v1/payment_methods/xxx/three_d_secure/lookup

Request billing part:

"additionalInfo": {
        "billingCity": "Leeds",
        "billingCountryCode": "GB",
        "billingGivenName": "John",
        "billingLine1": "50 Upton Road",
        "billingPhoneNumber": "07733222111",
        "billingPostalCode": "LE6 7TH",
        "billingState": "Yorkshire",
        "billingSurname": "Smith"
    },

Response:

{
    "error": {
        "message": "Billing state format is invalid."
    },
    "threeDSecureInfo": {
        "liabilityShiftPossible": false,
        "liabilityShifted": false
    }
}

If we remove the county field from the checkout (and ultimately the 'billingSate from the request), the response is valid and we are able to checkout fine.

Anyone have any ideas?


Solution

  • I did finally get an answer from Braintree regarding this. Apparently 3ds2 is now enforced on the Sandbox, and this requires the state or county to be sent as a two digit code.

    On production, if the full name is sent, it will (currently) gracefully degrade to 3ds1 and complete.

    In an attempt to push people to using 3ds2, the Sandbox does not switch to 3ds1 and returns the error.