Customising your Braintree integration

In this article, we'll show you how to customise the information that  Braintree sends to Quaderno to correctly for your invoices and so you can be EU VAT compliant.

Customising the customer billing info

If you'd like to customise the billing info in your invoices, you can do so using the billing address and custom fields when you create the Braintree Customer in your back-end system.

We're a Rails house at Quaderno, so here's how we'd do it in Ruby:

customer = Braintree::Customer.create(
  first_name: 'Maurice',
  last_name: 'Moss',
  company: 'Reynholm Industries',
  email: 'moss.m@reynholm.com',
  payment_method_nonce: 'nonce-from-the-client',
  credit_card: {
    billing_address: {
      street_address: '123 Carenden Road',
      locality: 'London',
      postal_code: 'EC5M 8AJ',
      country_code_alpha2: 'GB'
    }
  },
  custom_fields: {
    vat_number: 'GB184089977',
    ip_address: request.ip
  }
)

As in the above example, you can use two custom fields  (custom_fields) to specify your customer's IP address and VAT number. Both fields are optional.

We recommend, when creating a customer in Braintree, that you always send the country and IP address. This will make it easier to be EU VAT compliant.

Customising the transaction info

For one-off transactions, you can also specify the description of the transaction with custom fields when creating the transaction in Braintree. For example: 

transaction = Braintree::Transaction.sale(
  amount: '10.00',
  payment_method_nonce: nonce_from_the_client,
  custom_fields: {
    transaction_description: 'The Neverending Story, Michael Ende (EPUB)'
  }
)

Remember, before using any custom field, custom field names must be configured in your Braintree Control Panel, and values must be less than 255 characters.

Please select the option Store and Pass Back when you create a custom field. Quaderno needs these fields to be stored in your Braintree account.

Custom fields

All custom fields are optional. Quaderno can handle the following:

Custom Field Description
vat_number Billing VAT Number (only for customers)
ip_address
Customer's IP Address (only for customers)
transaction_description
Description of the transaction (only for one-off transactions)
additional_evidence_country
Code for the evidence country in standard format: ISO 3166-1 alpha-2 (ES, FR, US, GB, etc.)
additional_evidence_evidence_type 
Brief description (max 255 characters) of the evidence