spree_iugu_bank_slip 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.rspec +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +9 -0
- data/Guardfile +90 -0
- data/LICENSE +26 -0
- data/README.md +48 -0
- data/Rakefile +21 -0
- data/app/assets/javascripts/spree/backend/spree_iugu_bank_slip.js +2 -0
- data/app/assets/javascripts/spree/frontend/spree_iugu_bank_slip.js +2 -0
- data/app/assets/stylesheets/spree/backend/spree_iugu_bank_slip.css +3 -0
- data/app/assets/stylesheets/spree/frontend/spree_iugu_bank_slip.css +4 -0
- data/app/controllers/spree/admin/bank_slip_settings_controller.rb +27 -0
- data/app/controllers/spree/bank_slips_controller.rb +32 -0
- data/app/models/spree/bank_slip.rb +109 -0
- data/app/models/spree/payment_method/bank_slip.rb +175 -0
- data/app/overrides/spree/admin/shared/sub_menu/_configuration/add_bank_slip_settings_tab.html.erb.deface +2 -0
- data/app/overrides/spree/payments/_payment/add_bank_slip_info_to_details.html.erb.deface +8 -0
- data/app/views/spree/admin/bank_slip_settings/edit.html.erb +45 -0
- data/app/views/spree/admin/payments/source_forms/_bankslip.html.erb +3 -0
- data/app/views/spree/admin/payments/source_views/_bankslip.html.erb +39 -0
- data/app/views/spree/checkout/payment/_bankslip.html.erb +3 -0
- data/bin/rails +7 -0
- data/config/locales/en.yml +29 -0
- data/config/locales/pt-br.yml +29 -0
- data/config/routes.rb +13 -0
- data/db/migrate/20160105163131_create_spree_bank_slips.rb +17 -0
- data/lib/generators/spree_iugu_bank_slip/install/install_generator.rb +31 -0
- data/lib/spree/bank_slip_configuration.rb +11 -0
- data/lib/spree_iugu_bank_slip.rb +4 -0
- data/lib/spree_iugu_bank_slip/engine.rb +33 -0
- data/lib/spree_iugu_bank_slip/factories.rb +32 -0
- data/spec/controllers/spree/bank_slips_controller_spec.rb +39 -0
- data/spec/features/admin/bank_slip_settings_spec.rb +63 -0
- data/spec/fixtures/iugu_responses/create.json +131 -0
- data/spec/fixtures/iugu_responses/create_error.json +136 -0
- data/spec/fixtures/iugu_responses/fetch.json +131 -0
- data/spec/models/spree/bank_slip_spec.rb +56 -0
- data/spec/models/spree/payment_method/bank_slip_spec.rb +90 -0
- data/spec/spec_helper.rb +99 -0
- data/spec/support/capybara_login.rb +13 -0
- data/spree_iugu_bank_slip.gemspec +42 -0
- metadata +402 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
<!-- replace "erb[silent]:contains('else')" -->
|
2
|
+
<% elsif source.is_a?(Spree::BankSlip) %>
|
3
|
+
<label><%= Spree.t(:payment_method_bank_slip) %></label><br />
|
4
|
+
<% if source.payment_due? %>
|
5
|
+
<span><%= "#{Spree.t(:payment_due)}: #{ l source.payment_due }" %></span><br />
|
6
|
+
<% end %>
|
7
|
+
<%= link_to Spree.t(:generate_bank_slip), bank_slip_path(source.id), target: '_blank', class: 'btn btn-sm btn-info' if source.pending? %>
|
8
|
+
<% else %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>
|
2
|
+
|
3
|
+
<% content_for :page_title do %>
|
4
|
+
<%= Spree.t(:bank_slip_settings) %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<%= form_tag admin_bank_slip_settings_path, method: :put do |form| %>
|
8
|
+
<div id="billet_preferences" data-hook="billet_preferences">
|
9
|
+
<div class="panel panel-default">
|
10
|
+
<div class="panel-heading">
|
11
|
+
<h1 class="panel-title">
|
12
|
+
<%= Spree.t(:settings) %>
|
13
|
+
</h1>
|
14
|
+
</div>
|
15
|
+
<div class="panel-body">
|
16
|
+
<div class="row">
|
17
|
+
<div class="col-sm-4">
|
18
|
+
<%= label_tag(:iugu_api_token, Spree.t(:iugu_api_token) + ': ') + tag(:br) %>
|
19
|
+
<%= text_field_tag :iugu_api_token, @config.iugu_api_token, class: 'form-control' %>
|
20
|
+
</div>
|
21
|
+
<div class="col-sm-4">
|
22
|
+
<%= label_tag(:days_to_due_date, Spree.t(:days_to_due_date) + ': ') + tag(:br) %>
|
23
|
+
<%= text_field_tag :days_to_due_date, @config.days_to_due_date, class: 'form-control' %>
|
24
|
+
</div>
|
25
|
+
<div class="col-sm-4">
|
26
|
+
<%= label_tag(:ignore_due_email , Spree.t(:ignore_due_email) + ': ') + tag(:br) %>
|
27
|
+
<%= radio_button_tag :ignore_due_email, true, @config.ignore_due_email %>
|
28
|
+
<%= label_tag(:ignore_due_email_true, Spree.t(:true)) %>
|
29
|
+
<%= radio_button_tag :ignore_due_email, false, @config.ignore_due_email == false %>
|
30
|
+
<%= label_tag(:ignore_due_email_false, Spree.t(:false)) %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div class="row">
|
34
|
+
<div class="col-sm-12">
|
35
|
+
<%= label_tag(:doc_customer_attr, Spree.t(:doc_customer_attr) + ': ') + tag(:br) %>
|
36
|
+
<%= select_tag :doc_customer_attr,
|
37
|
+
options_for_select(@user_attr.collect { |item| [Spree.t(item), item] }, @config.doc_customer_attr),
|
38
|
+
class: 'select2', include_blank: true %>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: edit_admin_bank_slip_settings_url } %>
|
45
|
+
<% end %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<fieldset data-hook="billet">
|
2
|
+
<legend>
|
3
|
+
<%= Spree.t(:bank_slip_title) %>
|
4
|
+
</legend>
|
5
|
+
<table class="table table-condensed table-bordered">
|
6
|
+
<tr>
|
7
|
+
<th><%= Spree.t(:invoice_id) %>:</th>
|
8
|
+
<td><%= payment.source.invoice_id %>
|
9
|
+
</tr>
|
10
|
+
<tr>
|
11
|
+
<th><%= Spree.t(:amount) %>:</th>
|
12
|
+
<td><%= payment.source.display_amount.to_html %>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<th><%= Spree.t(:payment_due) %>:</th>
|
16
|
+
<td><%= l payment.source.payment_due if payment.source.payment_due? %>
|
17
|
+
</tr>
|
18
|
+
<% if payment.source.paid? %>
|
19
|
+
<tr>
|
20
|
+
<th><%= Spree.t(:paid_in) %>:</th>
|
21
|
+
<td><%= payment.source.paid_in.strftime(t('date.formats.default')) rescue '' %>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
<tr>
|
25
|
+
<th><%= Spree.t(:status) %>:</th>
|
26
|
+
<td>
|
27
|
+
<label class="label label-<%= payment.source.status %>"><%= Spree.t(payment.source.status) %></label>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
<% if payment.source.pending? %>
|
31
|
+
<tr>
|
32
|
+
<td colspan="2">
|
33
|
+
<%= link_to Spree.t(:generate_bank_slip), bank_slip_path(payment.source_id),
|
34
|
+
target: '_blank', class: 'btn btn-sm btn-info pull-right' %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
</table>
|
39
|
+
</fieldset>
|
data/bin/rails
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
2
|
+
|
3
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
4
|
+
ENGINE_PATH = File.expand_path('../../lib/spree_iugu_bank_slip/engine', __FILE__)
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
en:
|
2
|
+
bank_slip_settings: Iugu Bank Slip Settings
|
3
|
+
activerecord:
|
4
|
+
models:
|
5
|
+
spree/bank_slip:
|
6
|
+
one: Bank Slip
|
7
|
+
other: Bank Slips
|
8
|
+
spree:
|
9
|
+
bank_slip_settings: Iugu Bank Slip Settings
|
10
|
+
bank_slip_title: Bank Slip
|
11
|
+
iugu_api_token: API Token
|
12
|
+
days_to_due_date: Days to Due Date
|
13
|
+
ignore_due_email: Ignore Due Email
|
14
|
+
doc_customer_attr: Doc. Customer Attribute
|
15
|
+
shipment_total: Shipment Total
|
16
|
+
payment_method_bank_slip: Bank Slip
|
17
|
+
payment_due: Due Date
|
18
|
+
paid_in: Paid In
|
19
|
+
invoice_id: Invoice ID
|
20
|
+
generate_bank_slip: Generate Billet
|
21
|
+
bank_slip:
|
22
|
+
messages:
|
23
|
+
iugu_fail: Request to Iugu fail!
|
24
|
+
source_fail: Source could not be saved!
|
25
|
+
successfully_authorized: Payment successfully authorized!
|
26
|
+
successfully_captured: Payment successfully captured!
|
27
|
+
capture_fail: The capture fail!
|
28
|
+
successfully_voided: Payment successfully voided!
|
29
|
+
void_fail: The void fail!
|
@@ -0,0 +1,29 @@
|
|
1
|
+
pt-BR:
|
2
|
+
bank_slip_settings: "Configuração Boleto Iugu"
|
3
|
+
activerecord:
|
4
|
+
models:
|
5
|
+
spree/bank_slip:
|
6
|
+
one: Iugu Boleto
|
7
|
+
other: Iugu Boleto
|
8
|
+
spree:
|
9
|
+
bank_slip_settings: "Configuração Boleto Iugu"
|
10
|
+
bank_slip_title: Boleto Iugu
|
11
|
+
iugu_api_token: Token API
|
12
|
+
days_to_due_date: Dias para o Vencimento
|
13
|
+
ignore_due_email: "Ignorar Email de Cobrança"
|
14
|
+
doc_customer_attr: Atributo que Rep. o Documento do Cliente
|
15
|
+
shipment_total: Valor do frete
|
16
|
+
payment_method_bank_slip: Boleto
|
17
|
+
payment_due: Data de Vencimento
|
18
|
+
paid_in: Pago Em
|
19
|
+
invoice_id: "Número Boleto"
|
20
|
+
generate_bank_slip: Gerar boleto
|
21
|
+
bank_slip:
|
22
|
+
messages:
|
23
|
+
iugu_fail: "Requisição falhou!"
|
24
|
+
source_fail: "Pagamento não pode ser salvo!"
|
25
|
+
successfully_authorized: Pagamento autorizado com sucesso!
|
26
|
+
successfully_captured: Pagamento capturado com sucesso!
|
27
|
+
capture_fail: A captura falhou!
|
28
|
+
successfully_voided: Pagamento cancelado com sucesso!
|
29
|
+
void_fail: O cancelamento falhou!
|
data/config/routes.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Spree::Core::Engine.routes.draw do
|
2
|
+
|
3
|
+
namespace :admin do
|
4
|
+
resource :bank_slip_settings, only: [:show, :edit, :update]
|
5
|
+
end
|
6
|
+
|
7
|
+
resources :bank_slips, only: [:show] do
|
8
|
+
# Rota para a mudanca de status da fatura enviada pelo Iugu
|
9
|
+
post 'status_changed'
|
10
|
+
get 'status_changed'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateSpreeBankSlips < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :spree_bank_slips do |t|
|
4
|
+
t.string :invoice_id
|
5
|
+
t.decimal :amount
|
6
|
+
t.string :status
|
7
|
+
t.date :payment_due
|
8
|
+
t.date :paid_in
|
9
|
+
t.string :url
|
10
|
+
t.string :pdf
|
11
|
+
t.references :payment_method
|
12
|
+
t.references :user
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module SpreeIuguBankSlip
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
class_option :auto_run_migrations, :type => :boolean, :default => false
|
6
|
+
|
7
|
+
def add_javascripts
|
8
|
+
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_iugu_bank_slip\n"
|
9
|
+
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/spree_iugu_bank_slip\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_stylesheets
|
13
|
+
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/spree_iugu_bank_slip\n", :before => /\*\//, :verbose => true
|
14
|
+
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/spree_iugu_bank_slip\n", :before => /\*\//, :verbose => true
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_migrations
|
18
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_iugu_bank_slip'
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_migrations
|
22
|
+
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
|
23
|
+
if run_migrations
|
24
|
+
run 'bundle exec rake db:migrate'
|
25
|
+
else
|
26
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Spree
|
2
|
+
class BankSlipConfiguration < Spree::Preferences::Configuration
|
3
|
+
|
4
|
+
preference :iugu_api_token, :string # Token do Iugu
|
5
|
+
preference :doc_customer_attr, :string # Atributo que representa o documento do cliente
|
6
|
+
preference :days_to_due_date, :integer, default: 3 # Dias para a data de vencimento
|
7
|
+
preference :ignore_due_email, :boolean, default: true # Ignorar email de cobranca
|
8
|
+
preference :log_requests, :boolean, default: false # Salva no log os parametros enviados e recebidos nas requisicoes
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module SpreeIuguBankSlip
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'spree_iugu_bank_slip'
|
6
|
+
|
7
|
+
initializer 'spree.iugu_bank_slip.preferences', :after => :load_config_initializers do |app|
|
8
|
+
# inicializa o objeto com as configuracoes do Iugu
|
9
|
+
require 'spree/bank_slip_configuration'
|
10
|
+
Spree::BankSlipConfig = Spree::BankSlipConfiguration.new
|
11
|
+
|
12
|
+
# Insere no objeto do Iugu o token salvo
|
13
|
+
Iugu.api_key = Spree::BankSlipConfig[:iugu_api_token]
|
14
|
+
end
|
15
|
+
|
16
|
+
initializer 'spree.iugu_bank_slip.payment_methods', :after => 'spree.register.payment_methods' do |app|
|
17
|
+
app.config.spree.payment_methods << Spree::PaymentMethod::BankSlip
|
18
|
+
end
|
19
|
+
|
20
|
+
# use rspec for tests
|
21
|
+
config.generators do |g|
|
22
|
+
g.test_framework :rspec
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.activate
|
26
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
27
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
config.to_prepare &method(:activate).to_proc
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :slip_payment_method, class: Spree::PaymentMethod::BankSlip do
|
3
|
+
name 'Bank Slip'
|
4
|
+
created_at Date.today
|
5
|
+
end
|
6
|
+
|
7
|
+
factory :bank_slip, class: Spree::BankSlip do
|
8
|
+
status 'pending'
|
9
|
+
amount 10.0
|
10
|
+
paid_in nil
|
11
|
+
invoice_id 1
|
12
|
+
payment_method FactoryGirl.build(:slip_payment_method)
|
13
|
+
user
|
14
|
+
association(:order, factory: :order)
|
15
|
+
|
16
|
+
factory :bank_slip_with_payment do
|
17
|
+
association(:payment, factory: :slip_payment_without_source)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
factory :slip_payment_without_source, class: Spree::Payment do
|
22
|
+
amount 15.99
|
23
|
+
association(:payment_method, factory: :slip_payment_method)
|
24
|
+
order
|
25
|
+
state 'checkout'
|
26
|
+
response_code '1'
|
27
|
+
|
28
|
+
factory :slip_payment do
|
29
|
+
association(:source, factory: :bank_slip)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spree::BankSlipsController, type: :controller do
|
4
|
+
|
5
|
+
let(:slip) { create(:bank_slip_with_payment) }
|
6
|
+
|
7
|
+
context '#status_changed' do
|
8
|
+
|
9
|
+
it 'should change status to paid' do
|
10
|
+
request_params = {
|
11
|
+
bank_slip_id: slip.id,
|
12
|
+
data: {
|
13
|
+
id: slip.id,
|
14
|
+
status: 'paid'
|
15
|
+
}
|
16
|
+
}
|
17
|
+
post :status_changed, request_params
|
18
|
+
|
19
|
+
expect(response.status).to eq 200
|
20
|
+
expect(slip.reload.paid?).to be true
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should change status to canceled' do
|
24
|
+
request_params = {
|
25
|
+
bank_slip_id: slip.id,
|
26
|
+
data: {
|
27
|
+
id: slip.id,
|
28
|
+
status: 'canceled'
|
29
|
+
}
|
30
|
+
}
|
31
|
+
post :status_changed, request_params
|
32
|
+
|
33
|
+
expect(response.status).to eq 200
|
34
|
+
expect(slip.reload.canceled?).to be true
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Bank Slip Settings', { type: :feature, js: true } do
|
4
|
+
|
5
|
+
before { create_admin_in_sign_in }
|
6
|
+
|
7
|
+
context 'show billet settings' do
|
8
|
+
|
9
|
+
it 'should show bank slip settings' do
|
10
|
+
visit spree.edit_admin_bank_slip_settings_path
|
11
|
+
|
12
|
+
expect(page).to have_selector '#iugu_api_token'
|
13
|
+
expect(page).to have_selector '#doc_customer_attr'
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'edit bank slip settings' do
|
19
|
+
|
20
|
+
before { visit spree.edit_admin_bank_slip_settings_path }
|
21
|
+
|
22
|
+
after(:all) do
|
23
|
+
Spree::BankSlipConfig[:doc_customer_attr] = ''
|
24
|
+
Spree::BankSlipConfig[:iugu_api_token] = ''
|
25
|
+
Spree::BankSlipConfig[:days_to_due_date] = 3
|
26
|
+
Spree::BankSlipConfig[:ignore_due_email] = true
|
27
|
+
Iugu.api_key = ''
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'can edit Iugu api token' do
|
31
|
+
fill_in 'iugu_api_token', with: 'abc1234'
|
32
|
+
click_button 'Update'
|
33
|
+
|
34
|
+
expect(Spree::BankSlipConfig[:iugu_api_token]).to eq 'abc1234'
|
35
|
+
expect(find_field('iugu_api_token').value).to eq 'abc1234'
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'can edit days to due date' do
|
39
|
+
fill_in 'days_to_due_date', with: 10
|
40
|
+
click_button 'Update'
|
41
|
+
|
42
|
+
expect(Spree::BankSlipConfig[:days_to_due_date]).to eq 10
|
43
|
+
expect(find_field('days_to_due_date').value).to eq '10'
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'can edit ignore due email' do
|
47
|
+
find(:css, '#ignore_due_email_false').set false
|
48
|
+
click_button 'Update'
|
49
|
+
|
50
|
+
expect(Spree::BankSlipConfig[:ignore_due_email]).to be false
|
51
|
+
expect(find_field('ignore_due_email_false')).to be_checked
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'can edit document customer attribute', js: true do
|
55
|
+
select2 'Authentication Token', from: 'Doc. Customer Attribute'
|
56
|
+
click_button 'Update'
|
57
|
+
|
58
|
+
expect(Spree::BankSlipConfig[:doc_customer_attr]).to eq 'authentication_token'
|
59
|
+
expect(find_field('doc_customer_attr').value).to eq 'authentication_token'
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
{
|
2
|
+
"id": "1",
|
3
|
+
"due_date": "2016-01-09",
|
4
|
+
"currency": "BRL",
|
5
|
+
"discount_cents": null,
|
6
|
+
"email": "spree@example.com",
|
7
|
+
"items_total_cents": 1000,
|
8
|
+
"notification_url": null,
|
9
|
+
"return_url": null,
|
10
|
+
"status": "pending",
|
11
|
+
"tax_cents": null,
|
12
|
+
"updated_at": "2016-01-06T13:24:21-02:00",
|
13
|
+
"total_cents": 1000,
|
14
|
+
"total_paid_cents": 0,
|
15
|
+
"paid_at": null,
|
16
|
+
"taxes_paid_cents": null,
|
17
|
+
"paid_cents": null,
|
18
|
+
"cc_emails": null,
|
19
|
+
"financial_return_date": null,
|
20
|
+
"payable_with": "all",
|
21
|
+
"overpaid_cents": null,
|
22
|
+
"ignore_due_email": true,
|
23
|
+
"ignore_canceled_email": true,
|
24
|
+
"advance_fee_cents": null,
|
25
|
+
"secure_id": "1",
|
26
|
+
"secure_url": "http://localhost:3000",
|
27
|
+
"customer_id": null,
|
28
|
+
"customer_ref": null,
|
29
|
+
"customer_name": null,
|
30
|
+
"user_id": null,
|
31
|
+
"total": "R$ 10,00",
|
32
|
+
"taxes_paid": "R$ 0,00",
|
33
|
+
"total_paid": "R$ 0,00",
|
34
|
+
"total_overpaid": "R$ 0,00",
|
35
|
+
"fines_on_occurrence_day": null,
|
36
|
+
"total_on_occurrence_day": null,
|
37
|
+
"fines_on_occurrence_day_cents": null,
|
38
|
+
"total_on_occurrence_day_cents": null,
|
39
|
+
"advance_fee": null,
|
40
|
+
"paid": "R$ 0,00",
|
41
|
+
"interest": null,
|
42
|
+
"discount": null,
|
43
|
+
"created_at": "06/01, 13:24 h",
|
44
|
+
"refundable": null,
|
45
|
+
"installments": null,
|
46
|
+
"transaction_number": 1111,
|
47
|
+
"payment_method": null,
|
48
|
+
"created_at_iso": "2016-01-06T13:24:20-02:00",
|
49
|
+
"updated_at_iso": "2016-01-06T13:24:21-02:00",
|
50
|
+
"financial_return_dates": null,
|
51
|
+
"bank_slip": {
|
52
|
+
"digitable_line": "00000000000000000000000000000000000000000000000",
|
53
|
+
"barcode_data": "00000000000000000000000000000000000000000000",
|
54
|
+
"barcode": "http://localhost:3000"
|
55
|
+
},
|
56
|
+
"items": [
|
57
|
+
{
|
58
|
+
"id": "34F9D7F67E5244EF99796936CF208E35",
|
59
|
+
"description": "Item Um",
|
60
|
+
"price_cents": 1000,
|
61
|
+
"quantity": 1,
|
62
|
+
"created_at": "2016-01-06T13:24:20-02:00",
|
63
|
+
"updated_at": "2016-01-06T13:24:20-02:00",
|
64
|
+
"price": "R$ 10,00"
|
65
|
+
}
|
66
|
+
],
|
67
|
+
"variables": [
|
68
|
+
{
|
69
|
+
"id": "06B21226727C4121AC4BDB524DC0DA45",
|
70
|
+
"variable": "payer.address.country",
|
71
|
+
"value": "Brasil"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"id": "1D6D9BAA1D4E44F8A428B409371BF12F",
|
75
|
+
"variable": "payer.address.zip_code",
|
76
|
+
"value":"12122-00"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"id": "2D26D1E24B1240D1A42EF4826AF758E7",
|
80
|
+
"variable": "payer.phone",
|
81
|
+
"value": "12121212"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"id": "34B880D1A6EA4A8F81583B8093AFC548",
|
85
|
+
"variable": "payer.phone_prefix",
|
86
|
+
"value": "11"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"id": "5242B104C9F942A6A2891EB17B6AD3B1",
|
90
|
+
"variable": "payer.name",
|
91
|
+
"value": "Nome do Cliente"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"id": "605E45FCC8444E22A28BF38A2409582B",
|
95
|
+
"variable": "payer.address.number",
|
96
|
+
"value": "700"
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"id": "726310D0E206478E8F5609813C35387B",
|
100
|
+
"variable": "payment_data.transaction_number",
|
101
|
+
"value": "1111"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"id": "9DEA3D530F12427896818A60BABF753A",
|
105
|
+
"variable": "payer.address.street",
|
106
|
+
"value": "Rua Tal"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"id": "A4BD3C27296C440A8EC7F983F75132D8",
|
110
|
+
"variable": "payer.cpf_cnpj",
|
111
|
+
"value": "12312312312"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"id": "E66AF99801BA4071ABBD80FDA6A1B534",
|
115
|
+
"variable": "payer.address.city",
|
116
|
+
"value": "São Paulo"
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"id": "E9197DB3A6A74B9BBA4BCDF2E9553774",
|
120
|
+
"variable": "payer.email",
|
121
|
+
"value": "spree@example.com"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"id": "F2711AED42874D61ACC2D893EAAA43E0",
|
125
|
+
"variable": "payer.address.state",
|
126
|
+
"value": "SP"
|
127
|
+
}
|
128
|
+
],
|
129
|
+
"custom_variables": [],
|
130
|
+
"logs": []
|
131
|
+
}
|