Method: Adyen::API#generate_billet

Defined in:
lib/adyen/api.rb

#generate_billet(reference, amount, shopper_name, social_security_number, selected_brand, delivery_date, shopper_statement = nil) ⇒ PaymentService::BilletResponse

Generate a Billet - *Brazillian users only*

Billet (Boleto Bancário), often simply referred to as Boleto, is an offline payment method used in Brazil . The consumer will take the Boleto form to an ATM, bank, an approved facility, or access their online banking system to complete the payment. Once the Boleto is paid, the bank will send Adyen a file confirming that the payment was made, this usually takes one day, but it may occur up to 6 days after the payment. If a Boleto is not paid, the transaction will expire once the expirationDate is reached. For more information check the Adyen API Manual - 7 - Boleto Bancário(page 30)

Examples:

response = Adyen::API.generate_billet(
  invoice.id
  { currency: "BRL", value: (invoice.amount).to_i },
  { first_name: "Simon", last_name: "Hopper" },
  document_number,
  selected_brand,
  "2016-10-29T23:00:00.000Z",
  "Please send payment email to [email protected] after payment."
)
response.success? # => true

Parameters:

  • reference (Numeric, String)

    Your reference (ID) for this payment.

  • amount (Hash)

    A hash describing the money to charge.

  • shopper_name (Hash)

    A hash describing the shopper.

  • document_number (String)

    Social Security number (CPF in Brazil)

  • selected_brand (String)

    Billet brand

  • delivery_date (String)

    Payment date limit in ISO8601 format

  • optional (String)

    shopper_statement Payment instructions to Shopper

Options Hash (amount):

  • :currency (String)

    The ISO currency code (EUR, GBP, USD, etc).

  • :value (Integer)

    The value of the payment in discrete cents, unless the currency does not have cents.

Options Hash (shopper_name):

  • :first_name (String)

    The shopper’s first name

  • :last_name (String)

    The shopper’s last name

Returns:



94
95
96
97
98
99
100
101
102
103
# File 'lib/adyen/api.rb', line 94

def generate_billet(reference, amount, shopper_name, social_security_number, selected_brand, delivery_date, shopper_statement = nil)
  params = { :reference              => reference,
             :amount                 => amount,
             :shopper_name           => shopper_name,
             :social_security_number => social_security_number,
             :selected_brand         => selected_brand,
             :delivery_date          => delivery_date,
             :shopper_statement      => shopper_statement }
  PaymentService.new(params).generate_billet
end