question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drop-in prevented from tokenizing: "Street address is required"

See original GitHub issue

General information

  • SDK/Library version: braintree-web-drop-in 1.21.0
  • Environment: Production
  • Browser and OS: Firefox 72.0.2 on Linux

Issue description

Some users have been consistently experiencing the hostedFieldsFailedTokenizationError error, even though their information was correct. We have not been able to reproduce this issue until today when I encountered it myself. I’ve double-checked my information and it is correct.

I can reproduce it by:

  1. Having no vaulted payment methods
  2. Clicking “Card”
  3. Entering my credit card information, including CVV and Canadian postal code.
  4. Calling requestPaymentMethod(), which fails tokenization with the error hostedFieldsFailedTokenizationError

The same error is triggered with or without a space in the postal code: H0H0H0 or H0H 0H0

image

Possibly related to #486 ?


Here is the sanitized GraphQL request:

{
  "clientSdkMetadata": {
    "source": "client",
    "integration": "dropin2",
    "sessionId": "-snip-"
  },
  "query": "mutation TokenizeCreditCard($input: TokenizeCreditCardInput!) {   tokenizeCreditCard(input: $input) {     token     creditCard {       bin       brandCode       last4       expirationMonth      expirationYear      binData {         prepaid         healthcare         debit         durbinRegulated         commercial         payroll         issuingBank         countryOfIssuance         productId       }     }   } }",
  "variables": {
    "input": {
      "creditCard": {
        "number": "-snip-",
        "expirationMonth": "-snip-",
        "expirationYear": "-snip-",
        "cvv": "-snip-",
        "billingAddress": {
          "postalCode": "-snip-"
        }
      },
      "options": {
        "validate": true
      }
    }
  },
  "operationName": "TokenizeCreditCard"
}

Here is the sanitized GraphQL response:

{
  "extensions": {
    "requestId": "-snip-"
  },
  "data": {
    "tokenizeCreditCard": null
  },
  "errors": [
    {
      "message": "Street address is required",
      "locations": [
        {
          "line": 1,
          "column": 67
        }
      ],
      "path": [
        "tokenizeCreditCard"
      ],
      "extensions": {
        "errorType": "user_error",
        "errorClass": "VALIDATION",
        "legacyCode": "81811",
        "inputPath": [
          "input",
          "creditCard",
          "billingAddress",
          "streetAddress"
        ]
      }
    }
  ]
}

braintreegateway.com fraud management config:

image

image

image


braintree-web-drop-in config:

    {
      authorization: this.authorization,
      container: this.$refs.braintree,
      vaultManager: true,
      dataCollector: { kount: true, paypal: true },
      translations: {
        hostedFieldsFailedTokenizationError: 'Please verify your information and try again.',
        hostedFieldsFieldsInvalidError: 'Credit card validation failed. Please check your information and try again.',
      },
      card: {
        overrides: {
          styles: {
            input: {
              border: 'none',
            },
            '::placeholder': {
              color: '#bcc8e2',
              opacity: '1',
            },
          },
        },
      },
      paypal: {
        flow: 'vault',
        buttonStyle: {
          tagline: 'false',
          size: 'medium',
        },
      },
      paypalCredit: {
        flow: 'vault',
        buttonStyle: {
          tagline: 'false',
          size: 'medium',
        },
      },
    }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sshropshirecommented, Feb 24, 2020

Hi @AlbinoDrought thanks for using Braintree Web Drop-in.

AVS street address rules trigger when a credit card is vaulted. By default, when you generate a client token with a customer id, Drop-in will attempt to vault the card upon tokenization on the client, which triggers the verification.

We’re looking to add this feature in an upcoming release, and will notify when it is ready.

In the meantime as a workaround, you can:

  1. Prevent tokenizing automatically on the client. Edit the cardCreateOption and set card.vault.vaultCard = false
  2. Vault the card using the Braintree Server SDK and the nonce from the client along with the billing address you have collected from your customer
1reaction
AlbinoDroughtcommented, Feb 24, 2020

If I disable the AVS option “Street Address not provided (I)”:

image

I can successfully tokenize the same unchanged drop-in form.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dropin.js - Documentation - Braintree Open Source
dropin -model'); var EventEmitter = require('@braintree/event-emitter'); var assets ... See a full list of details in the [Hosted Fields client ...
Read more >
AVS and CVV Response Codes - PayPal Developer
A system error prevented any verification of street address or postal code. AVS not applicable (A), AVS information was provided but this type...
Read more >
Payment Method: Create | PHP
Street address must be less than or equal to 255 characters. Required to perform card verification when AVS rules are configured to require...
Read more >
How to show "Google Pay" option in Braintree Dropin?
However, when trying to create the Dropin-UI by myself, ... I crete the dropin-request using the Tokenization key like this:
Read more >
Encryption and Tokenization White Paper - Townsend Security
Many organizations will find both technologies helpful in different places in their it infrastructure. White Paper www.townsendsecurity.com. 724 Columbia Street ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found