mymoip 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -3
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -7
- data/README.md +46 -23
- data/VERSION +1 -1
- data/lib/mymoip/instruction.rb +15 -1
- data/mymoip.gemspec +2 -3
- data/test/fixtures/fixture.rb +4 -1
- data/test/test_instruction.rb +38 -6
- metadata +3 -4
- data/Gemfile.lock +0 -53
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.6.0
|
4
|
+
* Add support for Ruby 2.0.
|
5
|
+
* Improved installments option for Instructions.
|
6
|
+
|
3
7
|
## 0.5.0
|
4
8
|
* Breaking backward compatibility with exceptions raised. ArgumentError
|
5
9
|
is not used anymore. New MyMoip::InvalidComission, MyMoip::InvalidCreditCard,
|
data/Gemfile
CHANGED
@@ -1,17 +1,11 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem 'activesupport', '>= 2.3.5'
|
5
|
-
|
6
|
-
# Add dependencies to develop your gem here.
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
2
|
|
9
3
|
gem 'builder'
|
10
4
|
gem 'httparty'
|
11
5
|
gem 'activemodel'
|
12
6
|
|
13
7
|
group :development do
|
14
|
-
gem 'rdoc',
|
8
|
+
gem 'rdoc', '~> 3.12'
|
15
9
|
gem 'bundler', '>= 0'
|
16
10
|
gem 'jeweler', '~> 1.8.4'
|
17
11
|
gem 'turn'
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
MyMoip
|
2
|
-
======
|
1
|
+
# MyMoip
|
3
2
|
|
4
3
|
MoIP transactions in a gem to call your own.
|
5
4
|
|
@@ -7,12 +6,11 @@ Provides a implementation of MoIP's transparent checkout.
|
|
7
6
|
|
8
7
|
Planning to use with Rails? Check [my_moip-rails](https://github.com/Irio/my_moip-rails).
|
9
8
|
|
10
|
-
Contributing to MyMoip
|
11
|
-
----------------------
|
9
|
+
## Contributing to MyMoip
|
12
10
|
|
13
11
|
[![Build Status](https://secure.travis-ci.org/Irio/mymoip.png)](http://travis-ci.org/Irio/mymoip)
|
14
|
-
[![
|
15
|
-
|
12
|
+
[![Code
|
13
|
+
Climate](https://codeclimate.com/github/Irio/mymoip.png)](https://codeclimate.com/github/Irio/mymoip)
|
16
14
|
|
17
15
|
What would you do if you could make your own implementation of MoIP?
|
18
16
|
|
@@ -21,8 +19,7 @@ Any patch are welcome, even removing extra blank spaces.
|
|
21
19
|
1. Open a pull request.
|
22
20
|
2. Done.
|
23
21
|
|
24
|
-
Using
|
25
|
-
-----
|
22
|
+
## Using
|
26
23
|
|
27
24
|
Currently under active development.
|
28
25
|
|
@@ -31,7 +28,7 @@ Currently under active development.
|
|
31
28
|
gem 'mymoip'
|
32
29
|
```
|
33
30
|
|
34
|
-
|
31
|
+
### Configuration
|
35
32
|
```ruby
|
36
33
|
MyMoip.environment = "production" # "sandbox" by default
|
37
34
|
|
@@ -42,7 +39,8 @@ MyMoip.production_token = "your_moip_production_token"
|
|
42
39
|
MyMoip.production_key = "your_moip_production_key"
|
43
40
|
```
|
44
41
|
|
45
|
-
|
42
|
+
### First request: what and from who
|
43
|
+
|
46
44
|
```ruby
|
47
45
|
payer = MyMoip::Payer.new(
|
48
46
|
id: "payer_id_defined_by_you",
|
@@ -70,7 +68,8 @@ transparent_request = MyMoip::TransparentRequest.new("your_logging_id")
|
|
70
68
|
transparent_request.api_call(instruction)
|
71
69
|
```
|
72
70
|
|
73
|
-
|
71
|
+
### Second request: how
|
72
|
+
|
74
73
|
```ruby
|
75
74
|
credit_card = MyMoip::CreditCard.new(
|
76
75
|
logo: :visa,
|
@@ -78,7 +77,7 @@ credit_card = MyMoip::CreditCard.new(
|
|
78
77
|
expiration_date: "06/15",
|
79
78
|
security_code: "000",
|
80
79
|
owner_name: "Juquinha da Rocha",
|
81
|
-
owner_birthday:
|
80
|
+
owner_birthday: "03/11/1984",
|
82
81
|
owner_phone: "5130405060",
|
83
82
|
owner_cpf: "52211670695"
|
84
83
|
)
|
@@ -88,13 +87,20 @@ payment_request = MyMoip::PaymentRequest.new("your_logging_id")
|
|
88
87
|
payment_request.api_call(credit_card_payment, token: transparent_request.token)
|
89
88
|
```
|
90
89
|
|
91
|
-
|
90
|
+
### Success?
|
92
91
|
```ruby
|
93
92
|
payment_request.success?
|
94
93
|
```
|
95
94
|
|
96
|
-
|
97
|
-
|
95
|
+
## More!
|
96
|
+
|
97
|
+
Yes, you should read (and help improve!) the docs.
|
98
|
+
|
99
|
+
### Documentation
|
100
|
+
|
101
|
+
For more information about usage you can access the [wiki page](https://github.com/Irio/mymoip/wiki).
|
102
|
+
|
103
|
+
### Sending payments to multiple receivers
|
98
104
|
|
99
105
|
Choosing between commission with fixed or percentage value.
|
100
106
|
|
@@ -124,19 +130,36 @@ instruction = MyMoip::Instruction.new(
|
|
124
130
|
)
|
125
131
|
```
|
126
132
|
|
127
|
-
[
|
133
|
+
[More](https://github.com/Irio/mymoip/wiki/Sending-payments-to-multiple-receivers).
|
128
134
|
|
129
|
-
|
130
|
-
-------------
|
135
|
+
### Installments
|
131
136
|
|
132
|
-
|
137
|
+
The API allows you to set multiple configurations for installments.
|
138
|
+
|
139
|
+
On initialization of a MyMoip::Instruction, the #new method accepts a
|
140
|
+
installment option which will expect something like this array:
|
141
|
+
|
142
|
+
```ruby
|
143
|
+
installments = [
|
144
|
+
{ min: 1, max: 1, forward_taxes: false },
|
145
|
+
{ min: 2, max: 12, forward_taxes: true, fee: 1.99 } # 1.99 fee = 1.99% per month
|
146
|
+
]
|
147
|
+
|
148
|
+
MyMoip::Instruction.new(
|
149
|
+
id: "instruction_id_defined_by_you",
|
150
|
+
payment_reason: "Order in Buy Everything Store",
|
151
|
+
values: [100.0],
|
152
|
+
payer: payer,
|
153
|
+
installments: installments
|
154
|
+
)
|
155
|
+
```
|
156
|
+
|
157
|
+
[More](https://github.com/Irio/mymoip/wiki/Installments-use).
|
133
158
|
|
134
|
-
Going alive!
|
135
|
-
------------
|
159
|
+
## Going alive!
|
136
160
|
|
137
161
|
If you are ready to get your application using MyMoip approved by MoIP or already have valid production keys, you can read a specific [documentation](https://github.com/Irio/mymoip/wiki/Going-alive).
|
138
162
|
|
139
|
-
License
|
140
|
-
-------
|
163
|
+
## License
|
141
164
|
|
142
165
|
MIT. See LICENSE.txt for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
data/lib/mymoip/instruction.rb
CHANGED
@@ -4,7 +4,7 @@ module MyMoip
|
|
4
4
|
|
5
5
|
attr_accessor :id, :payment_reason, :values, :payer,
|
6
6
|
:commissions, :fee_payer_login, :payment_receiver_login,
|
7
|
-
:payment_receiver_name
|
7
|
+
:payment_receiver_name,:installments
|
8
8
|
|
9
9
|
validates_presence_of :id, :payment_reason, :values, :payer
|
10
10
|
validate :commissions_value_must_be_lesser_than_values
|
@@ -19,6 +19,7 @@ module MyMoip
|
|
19
19
|
self.fee_payer_login = attrs[:fee_payer_login]
|
20
20
|
self.payment_receiver_login = attrs[:payment_receiver_login]
|
21
21
|
self.payment_receiver_name = attrs[:payment_receiver_name]
|
22
|
+
self.installments = attrs[:installments]
|
22
23
|
end
|
23
24
|
|
24
25
|
def to_xml(root = nil)
|
@@ -38,6 +39,19 @@ module MyMoip
|
|
38
39
|
@values.each { |v| n3.Valor("%.2f" % v, moeda: "BRL") }
|
39
40
|
end
|
40
41
|
n2.IdProprio(@id)
|
42
|
+
|
43
|
+
if @installments
|
44
|
+
n2.Parcelamentos do |n4|
|
45
|
+
@installments.each do |i|
|
46
|
+
n4.Parcelamento do |n5|
|
47
|
+
n5.MinimoParcelas i[:min]
|
48
|
+
n5.MaximoParcelas i[:max]
|
49
|
+
n5.Repassar i[:forward_taxes] if i[:forward_taxes]
|
50
|
+
n5.Juros i[:fee]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
41
55
|
|
42
56
|
commissions_to_xml n2 if !commissions.empty?
|
43
57
|
payment_receiver_to_xml n2 if payment_receiver_login
|
data/mymoip.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mymoip"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Irio Irineu Musskopf Junior"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-04-27"
|
13
13
|
s.description = "Provides a implementation of MoIP's transparent checkout."
|
14
14
|
s.email = "irio.musskopf@caixadeideias.com.br"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
".travis.yml",
|
22
22
|
"CHANGELOG.md",
|
23
23
|
"Gemfile",
|
24
|
-
"Gemfile.lock",
|
25
24
|
"LICENSE.txt",
|
26
25
|
"README.md",
|
27
26
|
"Rakefile",
|
data/test/fixtures/fixture.rb
CHANGED
@@ -22,7 +22,10 @@ class Fixture
|
|
22
22
|
id: "your_own_instruction_id",
|
23
23
|
payment_reason: "some payment_reason",
|
24
24
|
values: [100.0, 200.0],
|
25
|
-
payer: payer
|
25
|
+
payer: payer,
|
26
|
+
installments: [
|
27
|
+
{min: 2, max: 12, forward_taxes: true, fee: 1.99}
|
28
|
+
]
|
26
29
|
}.merge(params)
|
27
30
|
MyMoip::Instruction.new(params)
|
28
31
|
end
|
data/test/test_instruction.rb
CHANGED
@@ -4,6 +4,7 @@ class TestInstruction < Test::Unit::TestCase
|
|
4
4
|
def test_getters_for_attributes
|
5
5
|
payer = Fixture.payer
|
6
6
|
commissions = [Fixture.commission]
|
7
|
+
installments = [{min: 2, max: 12, forward_taxes: true, fee: 1.99}]
|
7
8
|
instruction = MyMoip::Instruction.new(
|
8
9
|
id: "some id",
|
9
10
|
payment_reason: "some payment_reason",
|
@@ -12,7 +13,8 @@ class TestInstruction < Test::Unit::TestCase
|
|
12
13
|
commissions: commissions,
|
13
14
|
fee_payer_login: "fee_payer_login",
|
14
15
|
payment_receiver_login: "payment_receiver_login",
|
15
|
-
payment_receiver_name: "nick_fury"
|
16
|
+
payment_receiver_name: "nick_fury",
|
17
|
+
installments: installments
|
16
18
|
)
|
17
19
|
|
18
20
|
assert_equal "some id", instruction.id
|
@@ -20,6 +22,7 @@ class TestInstruction < Test::Unit::TestCase
|
|
20
22
|
assert_equal [100.0, 200.0], instruction.values
|
21
23
|
assert_equal payer, instruction.payer
|
22
24
|
assert_equal commissions, instruction.commissions
|
25
|
+
assert_equal installments, instruction.installments
|
23
26
|
assert_equal "fee_payer_login", instruction.fee_payer_login
|
24
27
|
assert_equal "payment_receiver_login", instruction.payment_receiver_login
|
25
28
|
assert_equal "nick_fury", instruction.payment_receiver_name
|
@@ -35,8 +38,36 @@ class TestInstruction < Test::Unit::TestCase
|
|
35
38
|
def test_xml_format
|
36
39
|
payer = Fixture.payer
|
37
40
|
instruction = Fixture.instruction(payer: payer)
|
41
|
+
|
38
42
|
expected_format = <<XML
|
39
|
-
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
43
|
+
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Parcelamentos><Parcelamento><MinimoParcelas>2</MinimoParcelas><MaximoParcelas>12</MaximoParcelas><Repassar>true</Repassar><Juros>1.99</Juros></Parcelamento></Parcelamentos><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
44
|
+
XML
|
45
|
+
assert_equal expected_format.rstrip, instruction.to_xml
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_xml_format_with_installments
|
49
|
+
payer = Fixture.payer
|
50
|
+
installments = [
|
51
|
+
{min: 5, max: 10, fee: 2.99}
|
52
|
+
]
|
53
|
+
instruction = Fixture.instruction(payer: payer, installments: installments)
|
54
|
+
|
55
|
+
expected_format = <<XML
|
56
|
+
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Parcelamentos><Parcelamento><MinimoParcelas>5</MinimoParcelas><MaximoParcelas>10</MaximoParcelas><Juros>2.99</Juros></Parcelamento></Parcelamentos><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
57
|
+
XML
|
58
|
+
assert_equal expected_format.rstrip, instruction.to_xml
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_xml_format_with_mutiple_installments
|
62
|
+
payer = Fixture.payer
|
63
|
+
installments = [
|
64
|
+
{min: 2, max: 6, fee: 1.99},
|
65
|
+
{min: 7, max: 12, fee: 2.99}
|
66
|
+
]
|
67
|
+
instruction = Fixture.instruction(payer: payer, installments: installments)
|
68
|
+
|
69
|
+
expected_format = <<XML
|
70
|
+
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Parcelamentos><Parcelamento><MinimoParcelas>2</MinimoParcelas><MaximoParcelas>6</MaximoParcelas><Juros>1.99</Juros></Parcelamento><Parcelamento><MinimoParcelas>7</MinimoParcelas><MaximoParcelas>12</MaximoParcelas><Juros>2.99</Juros></Parcelamento></Parcelamentos><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
40
71
|
XML
|
41
72
|
assert_equal expected_format.rstrip, instruction.to_xml
|
42
73
|
end
|
@@ -44,7 +75,7 @@ XML
|
|
44
75
|
def test_xml_format_with_commissions
|
45
76
|
commissions = [Fixture.commission(fixed_value: 5), Fixture.commission(percentage_value: 0.15, fixed_value: nil)]
|
46
77
|
payer = Fixture.payer
|
47
|
-
instruction = Fixture.instruction(payer: payer, commissions: commissions)
|
78
|
+
instruction = Fixture.instruction(payer: payer, commissions: commissions, installments: nil)
|
48
79
|
expected_format = <<XML
|
49
80
|
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Comissoes><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorFixo>5</ValorFixo></Comissionamento><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorPercentual>0.15</ValorPercentual></Comissionamento></Comissoes><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
50
81
|
XML
|
@@ -54,7 +85,7 @@ XML
|
|
54
85
|
def test_xml_format_with_commissions_and_fee_payer
|
55
86
|
commissions = [Fixture.commission(fixed_value: 5), Fixture.commission(percentage_value: 0.15,fixed_value: nil)]
|
56
87
|
payer = Fixture.payer
|
57
|
-
instruction = Fixture.instruction(payer: payer, commissions: commissions, fee_payer_login: 'fee_payer_indentifier')
|
88
|
+
instruction = Fixture.instruction(payer: payer, commissions: commissions, fee_payer_login: 'fee_payer_indentifier', installments: nil)
|
58
89
|
expected_format = <<XML
|
59
90
|
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Comissoes><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorFixo>5</ValorFixo></Comissionamento><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorPercentual>0.15</ValorPercentual></Comissionamento><PagadorTaxa><LoginMoIP>fee_payer_indentifier</LoginMoIP></PagadorTaxa></Comissoes><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
60
91
|
XML
|
@@ -66,7 +97,7 @@ XML
|
|
66
97
|
payer = Fixture.payer
|
67
98
|
instruction = Fixture.instruction(payer: payer, commissions: commissions,
|
68
99
|
payment_receiver_login:'payment_receiver_indentifier',
|
69
|
-
payment_receiver_name: 'nick_fury' )
|
100
|
+
payment_receiver_name: 'nick_fury', installments: nil)
|
70
101
|
expected_format = <<XML
|
71
102
|
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Comissoes><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorFixo>5</ValorFixo></Comissionamento><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorPercentual>0.15</ValorPercentual></Comissionamento></Comissoes><Recebedor><LoginMoIP>payment_receiver_indentifier</LoginMoIP><Apelido>nick_fury</Apelido></Recebedor><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
72
103
|
XML
|
@@ -79,7 +110,8 @@ XML
|
|
79
110
|
instruction = Fixture.instruction(payer: payer, commissions: commissions,
|
80
111
|
payment_receiver_login:'payment_receiver_indentifier',
|
81
112
|
payment_receiver_name: 'nick_fury',
|
82
|
-
fee_payer_login: 'fee_payer_indentifier'
|
113
|
+
fee_payer_login: 'fee_payer_indentifier',
|
114
|
+
installments: nil)
|
83
115
|
expected_format = <<XML
|
84
116
|
<EnviarInstrucao><InstrucaoUnica TipoValidacao=\"Transparente\"><Razao>some payment_reason</Razao><Valores><Valor moeda=\"BRL\">100.00</Valor><Valor moeda=\"BRL\">200.00</Valor></Valores><IdProprio>your_own_instruction_id</IdProprio><Comissoes><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorFixo>5</ValorFixo></Comissionamento><Comissionamento><Razao>Because we can</Razao><Comissionado><LoginMoIP>commissioned_indentifier</LoginMoIP></Comissionado><ValorPercentual>0.15</ValorPercentual></Comissionamento><PagadorTaxa><LoginMoIP>fee_payer_indentifier</LoginMoIP></PagadorTaxa></Comissoes><Recebedor><LoginMoIP>payment_receiver_indentifier</LoginMoIP><Apelido>nick_fury</Apelido></Recebedor><Pagador><Nome>Juquinha da Rocha</Nome><Email>juquinha@rocha.com</Email><IdPagador>your_own_payer_id</IdPagador><EnderecoCobranca><Logradouro>Felipe Neri</Logradouro><Numero>406</Numero><Complemento>Sala 501</Complemento><Bairro>Auxiliadora</Bairro><Cidade>Porto Alegre</Cidade><Estado>RS</Estado><Pais>BRA</Pais><CEP>90440-150</CEP><TelefoneFixo>(51)3040-5060</TelefoneFixo></EnderecoCobranca></Pagador></InstrucaoUnica></EnviarInstrucao>
|
85
117
|
XML
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mymoip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
@@ -183,7 +183,6 @@ files:
|
|
183
183
|
- .travis.yml
|
184
184
|
- CHANGELOG.md
|
185
185
|
- Gemfile
|
186
|
-
- Gemfile.lock
|
187
186
|
- LICENSE.txt
|
188
187
|
- README.md
|
189
188
|
- Rakefile
|
@@ -232,7 +231,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
231
|
version: '0'
|
233
232
|
segments:
|
234
233
|
- 0
|
235
|
-
hash:
|
234
|
+
hash: 165777608342011895
|
236
235
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
236
|
none: false
|
238
237
|
requirements:
|
data/Gemfile.lock
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
activemodel (3.2.11)
|
5
|
-
activesupport (= 3.2.11)
|
6
|
-
builder (~> 3.0.0)
|
7
|
-
activesupport (3.2.11)
|
8
|
-
i18n (~> 0.6)
|
9
|
-
multi_json (~> 1.0)
|
10
|
-
addressable (2.3.2)
|
11
|
-
ansi (1.4.3)
|
12
|
-
builder (3.0.4)
|
13
|
-
crack (0.3.2)
|
14
|
-
git (1.2.5)
|
15
|
-
httparty (0.10.0)
|
16
|
-
multi_json (~> 1.0)
|
17
|
-
multi_xml
|
18
|
-
i18n (0.6.1)
|
19
|
-
jeweler (1.8.4)
|
20
|
-
bundler (~> 1.0)
|
21
|
-
git (>= 1.2.5)
|
22
|
-
rake
|
23
|
-
rdoc
|
24
|
-
json (1.7.6)
|
25
|
-
metaclass (0.0.1)
|
26
|
-
mocha (0.13.1)
|
27
|
-
metaclass (~> 0.0.1)
|
28
|
-
multi_json (1.5.0)
|
29
|
-
multi_xml (0.5.2)
|
30
|
-
rake (10.0.3)
|
31
|
-
rdoc (3.12)
|
32
|
-
json (~> 1.4)
|
33
|
-
turn (0.9.6)
|
34
|
-
ansi
|
35
|
-
vcr (2.4.0)
|
36
|
-
webmock (1.9.0)
|
37
|
-
addressable (>= 2.2.7)
|
38
|
-
crack (>= 0.1.7)
|
39
|
-
|
40
|
-
PLATFORMS
|
41
|
-
ruby
|
42
|
-
|
43
|
-
DEPENDENCIES
|
44
|
-
activemodel
|
45
|
-
builder
|
46
|
-
bundler
|
47
|
-
httparty
|
48
|
-
jeweler (~> 1.8.4)
|
49
|
-
mocha
|
50
|
-
rdoc (~> 3.12)
|
51
|
-
turn
|
52
|
-
vcr
|
53
|
-
webmock
|