Customising your Braintree integration

If you'd like to, you can take your Braintree customisation to the next level by sending some extra information to the Braintree servers.

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
  }
)

Customising the transaction info

For one-off transactions, you can also specify the description of the transaction with custom fields. 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)'
  }
)

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)

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.

Still need help? Contact Us Contact Us