mundipagg_sdk 1.0.3 → 1.2.3rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -61
- data/lib/gateway/Address/billing_address.rb +34 -32
- data/lib/gateway/Address/buyer_address.rb +39 -36
- data/lib/gateway/Address/delivery_address.rb +34 -32
- data/lib/gateway/BoletoTransaction/boleto_transaction.rb +41 -43
- data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +17 -14
- data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +22 -19
- data/lib/gateway/CreditCardTransaction/credit_card.rb +30 -29
- data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +33 -31
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +28 -26
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +31 -28
- data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +14 -11
- data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +14 -12
- data/lib/gateway/Gateway.rb +621 -441
- data/lib/gateway/InstantBuyData/create_instant_buy_data_request.rb +31 -0
- data/lib/gateway/InstantBuyData/update_instant_buy_data_request.rb +11 -0
- data/lib/gateway/Merchant/merchant.rb +12 -10
- data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +21 -18
- data/lib/gateway/Order/order.rb +13 -10
- data/lib/gateway/Order/order_transaction_report_file.rb +8 -5
- data/lib/gateway/Parsers/boleto_transaction_parser.rb +33 -30
- data/lib/gateway/Parsers/credit_card_transaction_parser.rb +42 -39
- data/lib/gateway/Parsers/header_parser.rb +16 -13
- data/lib/gateway/Parsers/online_debit_transaction_parser.rb +32 -29
- data/lib/gateway/Parsers/trailer_parser.rb +16 -14
- data/lib/gateway/Person/buyer.rb +32 -32
- data/lib/gateway/Person/create_buyer_request.rb +23 -0
- data/lib/gateway/Person/person.rb +48 -46
- data/lib/gateway/Recurrency/recurrency.rb +24 -22
- data/lib/gateway/Sale/create_sale_request.rb +37 -35
- data/lib/gateway/Sale/manage_sale_request.rb +18 -16
- data/lib/gateway/Sale/query_sale_request.rb +37 -35
- data/lib/gateway/Sale/request_data.rb +21 -19
- data/lib/gateway/Sale/retry_sale_options.rb +15 -13
- data/lib/gateway/Sale/retry_sale_request.rb +23 -22
- data/lib/gateway/Sale/sale_data.rb +30 -32
- data/lib/gateway/Sale/sale_order_data.rb +18 -16
- data/lib/gateway/SalesOption.rb +19 -17
- data/lib/gateway/ShoppingCart/shopping_cart.rb +27 -25
- data/lib/gateway/ShoppingCart/shopping_cart_item.rb +24 -22
- data/lib/gateway/Trailer.rb +8 -5
- data/lib/gateway/header.rb +7 -4
- data/lib/gateway/post_notification.rb +31 -28
- data/lib/gateway/transaction_report_file.rb +47 -44
- data/lib/mundipagg_sdk.rb +62 -70
- data/mundipagg_sdk.gemspec +19 -19
- data/spec/integration/gateway_spec.rb +1022 -733
- data/spec/integration/test_helper.rb +68 -68
- metadata +7 -21
- data/lib/gateway/AntiFraud/anti_fraud_analysis_result.rb +0 -47
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb +0 -51
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +0 -41
- data/lib/gateway/BaseRequest.rb +0 -11
- data/lib/gateway/BaseResponse.rb +0 -17
- data/lib/gateway/BoletoTransaction/boleto_transaction_data.rb +0 -44
- data/lib/gateway/BoletoTransaction/boleto_transaction_result.rb +0 -35
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb +0 -104
- data/lib/gateway/ErrorItem.rb +0 -17
- data/lib/gateway/ErrorReport.rb +0 -18
- data/lib/gateway/InstantBuy/credit_card_data.rb +0 -41
- data/lib/gateway/InstantBuy/get_instant_buy_data_response.rb +0 -18
- data/lib/gateway/Sale/create_sale_response.rb +0 -25
- data/lib/gateway/Sale/manage_sale_response.rb +0 -15
- data/lib/gateway/Sale/query_sale_response.rb +0 -18
- data/lib/gateway/Sale/retry_sale_response.rb +0 -14
- data/lib/gateway/address.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba4b148bd5f3e62495fafd39dd8535022ce378b0
|
4
|
+
data.tar.gz: ef8ad3b3792a0d373b1247cf3ee0dc40b7ae55b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 848f62382a0474707a00374e4faf3249810e7d4e6cbc9ae3a32dcefd8685cdcaad12324fa98ab0e2edb507ea7ed21ade0b4840053e6a3e6b9c7c021440a9d651
|
7
|
+
data.tar.gz: e1c7efcb8f78757f67f5ca10e34c83a5f3673fc73351466962a7802d77993a06fc6d6a507be18fb2d925462862539ba92d08b46dd4134191cd0178f43e136807
|
data/README.md
CHANGED
@@ -1,61 +1,61 @@
|
|
1
|
-
# mundipagg-one-ruby [![Build Status](https://travis-ci.org/mundipagg/mundipagg-one-ruby.svg?branch=master)](https://travis-ci.org/mundipagg/mundipagg-one-ruby)
|
2
|
-
|
3
|
-
### Mundipagg Gem Download
|
4
|
-
https://rubygems.org/gems/mundipagg_sdk
|
5
|
-
|
6
|
-
```ruby
|
7
|
-
$ gem install mundipagg_sdk
|
8
|
-
```
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
require 'mundipagg_sdk'
|
12
|
-
```
|
13
|
-
|
14
|
-
Ruby DevKit is required.
|
15
|
-
|
16
|
-
### About Windows
|
17
|
-
The recommended Windows version of Ruby is Ruby 2.1.
|
18
|
-
For gems work correctly it'll be necessary run the following commands:
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
$ gem install rubygems-update
|
22
|
-
$ update_rubygems
|
23
|
-
$ gem update --system
|
24
|
-
```
|
25
|
-
### Required Gems
|
26
|
-
```ruby
|
27
|
-
$ gem install rest-client
|
28
|
-
$ gem install rspec
|
29
|
-
$ gem install nori
|
30
|
-
$ gem install gyoku
|
31
|
-
$ gem install nokogiri
|
32
|
-
$ gem install ffi
|
33
|
-
$ gem install bundler
|
34
|
-
```
|
35
|
-
### Bundler
|
36
|
-
Run the following commands to install gems:
|
37
|
-
|
38
|
-
Rode os seguintes comandos para instalar as gems:
|
39
|
-
```ruby
|
40
|
-
$ gem install bundler
|
41
|
-
$ bundle install
|
42
|
-
```
|
43
|
-
|
44
|
-
Running tests with `bundle exec`:
|
45
|
-
|
46
|
-
Rodando testes com `bundle exec`:
|
47
|
-
```ruby
|
48
|
-
$ bundle exec rspec spec/integration/gateway_spec.rb
|
49
|
-
```
|
50
|
-
|
51
|
-
Running tests with `rake`:
|
52
|
-
|
53
|
-
Rodando testes com `rake`:
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
$ rake
|
57
|
-
```
|
58
|
-
|
59
|
-
## Code Examples
|
60
|
-
|
61
|
-
You can access all the code examples [HERE, the Wiki page!](https://github.com/mundipagg/mundipagg-one-ruby/wiki)
|
1
|
+
# mundipagg-one-ruby [![Build Status](https://travis-ci.org/mundipagg/mundipagg-one-ruby.svg?branch=master)](https://travis-ci.org/mundipagg/mundipagg-one-ruby)
|
2
|
+
|
3
|
+
### Mundipagg Gem Download
|
4
|
+
https://rubygems.org/gems/mundipagg_sdk
|
5
|
+
|
6
|
+
```ruby
|
7
|
+
$ gem install mundipagg_sdk
|
8
|
+
```
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'mundipagg_sdk'
|
12
|
+
```
|
13
|
+
|
14
|
+
Ruby DevKit is required.
|
15
|
+
|
16
|
+
### About Windows
|
17
|
+
The recommended Windows version of Ruby is Ruby 2.1.
|
18
|
+
For gems work correctly it'll be necessary run the following commands:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
$ gem install rubygems-update
|
22
|
+
$ update_rubygems
|
23
|
+
$ gem update --system
|
24
|
+
```
|
25
|
+
### Required Gems
|
26
|
+
```ruby
|
27
|
+
$ gem install rest-client
|
28
|
+
$ gem install rspec
|
29
|
+
$ gem install nori
|
30
|
+
$ gem install gyoku
|
31
|
+
$ gem install nokogiri
|
32
|
+
$ gem install ffi
|
33
|
+
$ gem install bundler
|
34
|
+
```
|
35
|
+
### Bundler
|
36
|
+
Run the following commands to install gems:
|
37
|
+
|
38
|
+
Rode os seguintes comandos para instalar as gems:
|
39
|
+
```ruby
|
40
|
+
$ gem install bundler
|
41
|
+
$ bundle install
|
42
|
+
```
|
43
|
+
|
44
|
+
Running tests with `bundle exec`:
|
45
|
+
|
46
|
+
Rodando testes com `bundle exec`:
|
47
|
+
```ruby
|
48
|
+
$ bundle exec rspec spec/integration/gateway_spec.rb
|
49
|
+
```
|
50
|
+
|
51
|
+
Running tests with `rake`:
|
52
|
+
|
53
|
+
Rodando testes com `rake`:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
$ rake
|
57
|
+
```
|
58
|
+
|
59
|
+
## Code Examples
|
60
|
+
|
61
|
+
You can access all the code examples [HERE, the Wiki page!](https://github.com/mundipagg/mundipagg-one-ruby/wiki)
|
@@ -1,32 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class BillingAddress
|
4
|
+
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
5
|
+
attr_accessor :Country
|
6
|
+
|
7
|
+
# Estado
|
8
|
+
attr_accessor :State
|
9
|
+
|
10
|
+
# Cidade
|
11
|
+
attr_accessor :City
|
12
|
+
|
13
|
+
# Distrito
|
14
|
+
attr_accessor :District
|
15
|
+
|
16
|
+
# Logradouro
|
17
|
+
attr_accessor :Street
|
18
|
+
|
19
|
+
# Número
|
20
|
+
attr_accessor :Number
|
21
|
+
|
22
|
+
# Complemento
|
23
|
+
attr_accessor :Complement
|
24
|
+
|
25
|
+
# CEP
|
26
|
+
attr_accessor :ZipCode
|
27
|
+
|
28
|
+
def to_json
|
29
|
+
hash = {}
|
30
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
31
|
+
hash
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,36 +1,39 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class BuyerAddress
|
4
|
+
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
5
|
+
attr_accessor :Country
|
6
|
+
|
7
|
+
# Estado
|
8
|
+
attr_accessor :State
|
9
|
+
|
10
|
+
# Cidade
|
11
|
+
attr_accessor :City
|
12
|
+
|
13
|
+
# Distrito
|
14
|
+
attr_accessor :District
|
15
|
+
|
16
|
+
# Logradouro
|
17
|
+
attr_accessor :Street
|
18
|
+
|
19
|
+
# Número
|
20
|
+
attr_accessor :Number
|
21
|
+
|
22
|
+
# Complemento
|
23
|
+
attr_accessor :Complement
|
24
|
+
|
25
|
+
# CEP
|
26
|
+
attr_accessor :ZipCode
|
27
|
+
|
28
|
+
# Tipo de endereço
|
29
|
+
attr_accessor :AddressType
|
30
|
+
|
31
|
+
|
32
|
+
def to_json
|
33
|
+
hash = {}
|
34
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
35
|
+
hash
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -1,32 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class DeliveryAddress
|
4
|
+
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
5
|
+
attr_accessor :Country
|
6
|
+
|
7
|
+
# Estado
|
8
|
+
attr_accessor :State
|
9
|
+
|
10
|
+
# Cidade
|
11
|
+
attr_accessor :City
|
12
|
+
|
13
|
+
# Distrito
|
14
|
+
attr_accessor :District
|
15
|
+
|
16
|
+
# Logradouro
|
17
|
+
attr_accessor :Street
|
18
|
+
|
19
|
+
# Número
|
20
|
+
attr_accessor :Number
|
21
|
+
|
22
|
+
# Complemento
|
23
|
+
attr_accessor :Complement
|
24
|
+
|
25
|
+
# zip code
|
26
|
+
attr_accessor :ZipCode
|
27
|
+
|
28
|
+
def to_json
|
29
|
+
hash = {}
|
30
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
31
|
+
hash
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,43 +1,41 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
1
|
+
require 'json'
|
2
|
+
module Gateway
|
3
|
+
|
4
|
+
class BoletoTransaction
|
5
|
+
|
6
|
+
# Valor do boleto em centavos
|
7
|
+
attr_accessor :AmountInCents
|
8
|
+
|
9
|
+
# Número do banco
|
10
|
+
attr_accessor :BankNumber
|
11
|
+
|
12
|
+
# Instruções a serem impressas no boleto
|
13
|
+
attr_accessor :Instructions
|
14
|
+
|
15
|
+
# Número do documento
|
16
|
+
attr_accessor :DocumentNumber
|
17
|
+
|
18
|
+
# Indentificador da transação no sistema da loja
|
19
|
+
attr_accessor :TransactionReference
|
20
|
+
|
21
|
+
# Data da criação da transação no sistema da loja
|
22
|
+
attr_accessor :TransactionDateInMerchant
|
23
|
+
|
24
|
+
# Opções da transação de boleto
|
25
|
+
attr_accessor :Options
|
26
|
+
|
27
|
+
# Endereço de cobrança
|
28
|
+
attr_accessor :BillingAddress
|
29
|
+
|
30
|
+
def initialize
|
31
|
+
@Options = BoletoTransactionOptions.new
|
32
|
+
@BillingAddress = BillingAddress.new
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json
|
36
|
+
hash = {}
|
37
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
38
|
+
hash
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,14 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class BoletoTransactionOptions
|
4
|
+
# Total de dias para expirar o boleto
|
5
|
+
attr_accessor :DaysToAddInBoletoExpirationDate
|
6
|
+
|
7
|
+
# Moeda. Opções: BRL, EUR, USD, ARS, BOB, CLP, COP, UYU, MXN, PYG
|
8
|
+
attr_accessor :CurrencyIso
|
9
|
+
|
10
|
+
def to_json
|
11
|
+
hash = {}
|
12
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
13
|
+
hash
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|