Skip to content

400 Bad Request when using bank account tokenize method #473

@bengarrr

Description

@bengarrr

General information

  • SDK version: 3.54.2
  • Environment: Production
  • Browser and OS: Chrome Version 78.0.3904.70 (Official Build) (64-bit) Windows 10

Issue description

When using the usbankaccount.tokenize method I'm getting

"POST https://production.plaid.com/link/item/mfa 400 (Bad Request)"

Here's how I'm calling the tokenize method:

export default async () => {
  let auth = //production tokenization key

  try {
    //exchange token for client instance
    let client = await Client
      .create({
        authorization: auth
      })
      .catch(err => {
        console.log(err);
      });

    //create usbankaccount instance
    let usbankaccount = await UsBankAccount
      .create({
        client
      })
      .catch(err => {
        console.log(err);
      });

    window["BRAINTREE_CLIENT"] = client;
    window["BRAINTREE_USBANKACCOUNT"] = usbankaccount;
  } catch (e) {
    //error initializing
  }
};

...

let bankLogin = {
     displayName: this.display_name,
     ownershipType: this.ownershipTypeInput.value,
     billingAddress: {
       streetAddress: this.billingAddressStreetInput.value,
       extendedAddress: this.billingAddressExtendedInput.value,
       locality: this.billingAddressLocalityInput.value,
       region: this.billingAddressRegionSelect.value,
       postalCode: this.billingAddressPostalInput.value
     }
   } as any;

   if (bankLogin.ownershipType === "personal") {
     bankLogin = { ...bankLogin, firstName: this.firstNameInput.value };
     bankLogin = { ...bankLogin, lastName: this.lastNameInput.value };
   } else {
     bankLogin = { ...bankLogin, businessName: this.businessNameInput.value };
   }

   let nonce;
   try {
     nonce = await window["BRAINTREE_USBANKACCOUNT"].tokenize({
       bankLogin: bankLogin,
       mandateText: this.mandate
     });
   } catch (e) {
     //error getting paymethod nonce
     return;
   }

This is the error I get on the UI

chrome_2019-10-30_04-02-05

When "Setup Account" is selected it just opens the banks homepage

Activity

crookedneighbor

crookedneighbor commented on Oct 30, 2019

@crookedneighbor
Contributor

I assume this error happens after the plaid modal opens and after you've selected the specific SDCCU bank. Is this happening for other banks as well? or just that one?

I've forwarded this issue onto our Bank payments team and will have them contact our partner Plaid to see if we can get some insight into this. I suspect there's a specific setting you have to enable on your SCCCU bank account to allow it to be accessed by Plaid.

rajsharma714

rajsharma714 commented on Oct 30, 2019

@rajsharma714

I assume this error happens after the plaid modal opens and after you've selected the specific SDCCU bank. Is this happening for other banks as well? or just that one?

I've forwarded this issue onto our Bank payments team and will have them contact our partner Plaid to see if we can get some insight into this. I suspect there's a specific setting you have to enable on your SCCCU bank account to allow it to be accessed by Plaid.

For me, when I used it, I completed the payment form, verified with Plaid successfully, after the Plaid successful verification, it took me back to the payment page to submit the payment, I clicked SUBMIT, and Plaid popped up again, so I did it again, and once again, successful Plaid verification, clicked SUBMIT again, and same thing, it keeps looping. Hopefully I've explained this in a non confusing way.

crookedneighbor

crookedneighbor commented on Oct 30, 2019

@crookedneighbor
Contributor

Please open a support ticket with your public merchant ID so we can inspect your account: https://help.braintreepayments.com/

bengarrr

bengarrr commented on Oct 30, 2019

@bengarrr
Author

I was able to get it to work with another bank login. There must be something on my bank account's end that doesn't support Plaid.

I'm getting this error back from the Tokenize method now
chrome_2019-10-30_13-11-17

I'm assuming the ID it says is not found is the clientMutationId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bengarrr@crookedneighbor@rajsharma714

        Issue actions

          400 Bad Request when using bank account tokenize method · Issue #473 · braintree/braintree-web