Gem to communicate with EBANX Pay.
Documentation: https://developers.ebanxpagamentos.com/
Add this line to your application's Gemfile:
# EBANX SDK
gem 'ebanx', git: 'https://github.com/ebanx/ebanx-pay-ruby-sdk'
and bundle it
$ bundle
Ebanx.tap do |e|
e.integration_key = '<<< Your integration key >>>'
e.test_mode = true
end
response = Ebanx.do_direct(
operation: 'request',
mode: 'full',
payment: {
name: 'João da Silva',
email: '[email protected]',
currency_code: 'BRL',
amount_total: 100.50,
merchant_payment_code: Random.rand(10000000000),
payment_type_code: 'boleto',
person_type: 'personal',
document: '13326724691',
birth_date: '01/01/1980',
zipcode: '70000-000',
address: 'Rua Brasil',
street_number: '1',
city: 'Brasília',
state: 'DF',
country: 'br',
phone_number: '6130001111',
due_date: (Time.now + 86400).strftime('%d/%m/%Y')
}
)
response = Ebanx.do_direct(
operation: 'request',
mode: 'full',
payment: {
name: 'João da Silva',
email: '[email protected]',
currency_code: 'BRL',
amount_total: 100.50,
merchant_payment_code: Random.rand(10000000000),
payment_type_code: 'boleto',
person_type: 'personal',
document: '13326724691',
birth_date: '01/01/1980',
zipcode: '70000-000',
address: 'Rua Brasil',
street_number: '1',
city: 'Brasília',
state: 'DF',
country: 'br',
phone_number: '6130001111',
due_date: (Time.now + 86400).strftime('%d/%m/%Y'),
split: [
{
recipient_code: "me",
percentage: 50,
liable: true,
charge_fee: true
},
{
recipient_code: "other-one-recipient",
percentage: 50,
liable: false,
charge_fee: false
}
]
}
)
We use minitest for testing this Gem.
rake test
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request