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

400 Bad Request when using bank account tokenize method #473

Closed
bengarrr opened this issue Oct 30, 2019 · 4 comments
Closed

400 Bad Request when using bank account tokenize method #473

bengarrr opened this issue Oct 30, 2019 · 4 comments

Comments

@bengarrr
Copy link

bengarrr commented Oct 30, 2019

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

@crookedneighbor
Copy link
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
Copy link

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
Copy link
Contributor

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

@bengarrr
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants