mundipagg_sdk 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/LICENSE +190 -190
- data/README.md +61 -61
- data/lib/gateway/Address/billing_address.rb +33 -33
- data/lib/gateway/Address/buyer_address.rb +38 -38
- data/lib/gateway/Address/delivery_address.rb +34 -34
- data/lib/gateway/BoletoTransaction/boleto_transaction.rb +40 -40
- data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +16 -16
- data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +22 -22
- data/lib/gateway/CreditCardTransaction/credit_card.rb +30 -30
- data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +33 -33
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +28 -28
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +31 -31
- data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +14 -14
- data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +14 -14
- data/lib/gateway/Gateway.rb +525 -627
- data/lib/gateway/InstantBuyData/create_instant_buy_data_request.rb +30 -30
- data/lib/gateway/InstantBuyData/update_instant_buy_data_request.rb +10 -10
- data/lib/gateway/Merchant/merchant.rb +12 -12
- data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +21 -21
- data/lib/gateway/Order/order.rb +13 -13
- data/lib/gateway/Order/order_transaction_report_file.rb +8 -8
- data/lib/gateway/Parsers/boleto_transaction_parser.rb +33 -33
- data/lib/gateway/Parsers/credit_card_transaction_parser.rb +42 -42
- data/lib/gateway/Parsers/header_parser.rb +16 -16
- data/lib/gateway/Parsers/online_debit_transaction_parser.rb +32 -32
- data/lib/gateway/Parsers/trailer_parser.rb +16 -16
- data/lib/gateway/Person/buyer.rb +32 -32
- data/lib/gateway/Person/create_buyer_request.rb +22 -22
- data/lib/gateway/Person/person.rb +48 -48
- data/lib/gateway/Recurrency/recurrency.rb +24 -24
- data/lib/gateway/Sale/create_sale_request.rb +37 -37
- data/lib/gateway/Sale/manage_sale_request.rb +18 -18
- data/lib/gateway/Sale/query_sale_request.rb +37 -37
- data/lib/gateway/Sale/request_data.rb +21 -21
- data/lib/gateway/Sale/retry_sale_options.rb +15 -15
- data/lib/gateway/Sale/retry_sale_request.rb +23 -23
- data/lib/gateway/Sale/sale_data.rb +30 -30
- data/lib/gateway/Sale/sale_order_data.rb +18 -18
- data/lib/gateway/SalesOption.rb +18 -18
- data/lib/gateway/ShoppingCart/shopping_cart.rb +27 -27
- data/lib/gateway/ShoppingCart/shopping_cart_item.rb +24 -24
- data/lib/gateway/Trailer.rb +8 -8
- data/lib/gateway/header.rb +7 -7
- data/lib/gateway/post_notification.rb +31 -31
- data/lib/gateway/transaction_report_file.rb +47 -47
- data/lib/mundipagg_sdk.rb +61 -61
- data/mundipagg_sdk.gemspec +20 -20
- data/spec/integration/gateway_spec.rb +1023 -1022
- data/spec/integration/test_helper.rb +68 -68
- data/spec/spec_helper.rb +96 -96
- metadata +33 -33
@@ -1,17 +1,17 @@
|
|
1
|
-
module Gateway
|
2
|
-
class TrailerParser
|
3
|
-
def Parse(elements)
|
4
|
-
if elements.length < 5
|
5
|
-
throw('The expected parameter count is 5')
|
6
|
-
end
|
7
|
-
|
8
|
-
trailer = Trailer.new
|
9
|
-
trailer.OrderDataCount = elements[1]
|
10
|
-
trailer.CreditCardTransactionDataCount = elements[2]
|
11
|
-
trailer.BoletoTransactionDataCount = elements[3]
|
12
|
-
trailer.OnlineDebitTransactionDataCount = elements[4].chomp
|
13
|
-
|
14
|
-
return trailer
|
15
|
-
end
|
16
|
-
end
|
1
|
+
module Gateway
|
2
|
+
class TrailerParser
|
3
|
+
def Parse(elements)
|
4
|
+
if elements.length < 5
|
5
|
+
throw('The expected parameter count is 5')
|
6
|
+
end
|
7
|
+
|
8
|
+
trailer = Trailer.new
|
9
|
+
trailer.OrderDataCount = elements[1]
|
10
|
+
trailer.CreditCardTransactionDataCount = elements[2]
|
11
|
+
trailer.BoletoTransactionDataCount = elements[3]
|
12
|
+
trailer.OnlineDebitTransactionDataCount = elements[4].chomp
|
13
|
+
|
14
|
+
return trailer
|
15
|
+
end
|
16
|
+
end
|
17
17
|
end
|
data/lib/gateway/Person/buyer.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
require_relative 'person'
|
2
|
-
module Gateway
|
3
|
-
|
4
|
-
class Buyer < Person
|
5
|
-
# Chave do comprador. Utilizada para identificar um comprador no gateway
|
6
|
-
attr_accessor :BuyerKey
|
7
|
-
|
8
|
-
# Refer�ncia do comprador no sistema da loja
|
9
|
-
attr_accessor :BuyerReference
|
10
|
-
|
11
|
-
# Lista de endere�os do comprador
|
12
|
-
attr_accessor :AddressCollection
|
13
|
-
|
14
|
-
# Data de cria��o do comprador no sistema da loja
|
15
|
-
attr_accessor :CreateDateInMerchant
|
16
|
-
|
17
|
-
# Data da �ltima atualiza��o do cadastro do comprador no sistema da loja
|
18
|
-
attr_accessor :LastBuyerUpdateInMerchant
|
19
|
-
|
20
|
-
# Categoria do comprador
|
21
|
-
attr_accessor :BuyerCategory
|
22
|
-
|
23
|
-
def initialize
|
24
|
-
@AddressCollection = Array.new
|
25
|
-
end
|
26
|
-
|
27
|
-
def to_json
|
28
|
-
hash = {}
|
29
|
-
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
30
|
-
hash
|
31
|
-
end
|
32
|
-
end
|
1
|
+
require_relative 'person'
|
2
|
+
module Gateway
|
3
|
+
|
4
|
+
class Buyer < Person
|
5
|
+
# Chave do comprador. Utilizada para identificar um comprador no gateway
|
6
|
+
attr_accessor :BuyerKey
|
7
|
+
|
8
|
+
# Refer�ncia do comprador no sistema da loja
|
9
|
+
attr_accessor :BuyerReference
|
10
|
+
|
11
|
+
# Lista de endere�os do comprador
|
12
|
+
attr_accessor :AddressCollection
|
13
|
+
|
14
|
+
# Data de cria��o do comprador no sistema da loja
|
15
|
+
attr_accessor :CreateDateInMerchant
|
16
|
+
|
17
|
+
# Data da �ltima atualiza��o do cadastro do comprador no sistema da loja
|
18
|
+
attr_accessor :LastBuyerUpdateInMerchant
|
19
|
+
|
20
|
+
# Categoria do comprador
|
21
|
+
attr_accessor :BuyerCategory
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
@AddressCollection = Array.new
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_json
|
28
|
+
hash = {}
|
29
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
30
|
+
hash
|
31
|
+
end
|
32
|
+
end
|
33
33
|
end
|
@@ -1,23 +1,23 @@
|
|
1
|
-
module Gateway
|
2
|
-
class CreateBuyerRequest < Person
|
3
|
-
attr_accessor :AddressCollection
|
4
|
-
|
5
|
-
attr_accessor :BuyerCategory
|
6
|
-
|
7
|
-
attr_accessor :BuyerReference
|
8
|
-
|
9
|
-
attr_accessor :CreateDateInMerchant
|
10
|
-
|
11
|
-
attr_accessor :LastBuyerUpdateInMerchant
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@AddressCollection = Array.new
|
15
|
-
end
|
16
|
-
|
17
|
-
def to_json
|
18
|
-
hash = {}
|
19
|
-
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
20
|
-
hash
|
21
|
-
end
|
22
|
-
end
|
1
|
+
module Gateway
|
2
|
+
class CreateBuyerRequest < Person
|
3
|
+
attr_accessor :AddressCollection
|
4
|
+
|
5
|
+
attr_accessor :BuyerCategory
|
6
|
+
|
7
|
+
attr_accessor :BuyerReference
|
8
|
+
|
9
|
+
attr_accessor :CreateDateInMerchant
|
10
|
+
|
11
|
+
attr_accessor :LastBuyerUpdateInMerchant
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@AddressCollection = Array.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_json
|
18
|
+
hash = {}
|
19
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
20
|
+
hash
|
21
|
+
end
|
22
|
+
end
|
23
23
|
end
|
@@ -1,49 +1,49 @@
|
|
1
|
-
module Gateway
|
2
|
-
|
3
|
-
class Person
|
4
|
-
# Nome da pessoa
|
5
|
-
attr_accessor :Name
|
6
|
-
|
7
|
-
# Define se � pessoa f�sica ou jur�dica
|
8
|
-
attr_accessor :PersonType
|
9
|
-
|
10
|
-
# N�mero do documento
|
11
|
-
attr_accessor :DocumentNumber
|
12
|
-
|
13
|
-
# Tipo de documento
|
14
|
-
attr_accessor :DocumentType
|
15
|
-
|
16
|
-
# Sexo da pessoa
|
17
|
-
attr_accessor :Gender
|
18
|
-
|
19
|
-
# Data de nascimento
|
20
|
-
attr_accessor :Birthdate
|
21
|
-
|
22
|
-
# E-mail
|
23
|
-
attr_accessor :Email
|
24
|
-
|
25
|
-
# Tipo do email. Pessoal ou comercial
|
26
|
-
attr_accessor :EmailType
|
27
|
-
|
28
|
-
# C�digo identificador do cadastro no Facebook
|
29
|
-
attr_accessor :FacebookId
|
30
|
-
|
31
|
-
# C�digo identificador do cadastro no Twitter
|
32
|
-
attr_accessor :TwitterId
|
33
|
-
|
34
|
-
# Telefone celular
|
35
|
-
attr_accessor :MobilePhone
|
36
|
-
|
37
|
-
# Telefone Residencial
|
38
|
-
attr_accessor :HomePhone
|
39
|
-
|
40
|
-
# Telefone comercial
|
41
|
-
attr_accessor :WorkPhone
|
42
|
-
|
43
|
-
def to_json
|
44
|
-
hash = {}
|
45
|
-
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
46
|
-
hash
|
47
|
-
end
|
48
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class Person
|
4
|
+
# Nome da pessoa
|
5
|
+
attr_accessor :Name
|
6
|
+
|
7
|
+
# Define se � pessoa f�sica ou jur�dica
|
8
|
+
attr_accessor :PersonType
|
9
|
+
|
10
|
+
# N�mero do documento
|
11
|
+
attr_accessor :DocumentNumber
|
12
|
+
|
13
|
+
# Tipo de documento
|
14
|
+
attr_accessor :DocumentType
|
15
|
+
|
16
|
+
# Sexo da pessoa
|
17
|
+
attr_accessor :Gender
|
18
|
+
|
19
|
+
# Data de nascimento
|
20
|
+
attr_accessor :Birthdate
|
21
|
+
|
22
|
+
# E-mail
|
23
|
+
attr_accessor :Email
|
24
|
+
|
25
|
+
# Tipo do email. Pessoal ou comercial
|
26
|
+
attr_accessor :EmailType
|
27
|
+
|
28
|
+
# C�digo identificador do cadastro no Facebook
|
29
|
+
attr_accessor :FacebookId
|
30
|
+
|
31
|
+
# C�digo identificador do cadastro no Twitter
|
32
|
+
attr_accessor :TwitterId
|
33
|
+
|
34
|
+
# Telefone celular
|
35
|
+
attr_accessor :MobilePhone
|
36
|
+
|
37
|
+
# Telefone Residencial
|
38
|
+
attr_accessor :HomePhone
|
39
|
+
|
40
|
+
# Telefone comercial
|
41
|
+
attr_accessor :WorkPhone
|
42
|
+
|
43
|
+
def to_json
|
44
|
+
hash = {}
|
45
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
46
|
+
hash
|
47
|
+
end
|
48
|
+
end
|
49
49
|
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
module Gateway
|
2
|
-
|
3
|
-
class Recurrency
|
4
|
-
# Frequ�ncia da recorr�ncia
|
5
|
-
attr_accessor :Frequency
|
6
|
-
|
7
|
-
# Intervalo de recorr�ncia
|
8
|
-
attr_accessor :Interval
|
9
|
-
|
10
|
-
# Data da primeira cobran�a
|
11
|
-
attr_accessor :DateToStartBilling
|
12
|
-
|
13
|
-
# Total de recorr�ncias
|
14
|
-
attr_accessor :Recurrences
|
15
|
-
|
16
|
-
# Informa se ser� necess�rio efetuar o procedimento OneDollarAuth antes de registrar a recorr�ncia
|
17
|
-
attr_accessor :OneDollarAuth
|
18
|
-
|
19
|
-
def to_json
|
20
|
-
hash = {}
|
21
|
-
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
22
|
-
hash
|
23
|
-
end
|
24
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class Recurrency
|
4
|
+
# Frequ�ncia da recorr�ncia
|
5
|
+
attr_accessor :Frequency
|
6
|
+
|
7
|
+
# Intervalo de recorr�ncia
|
8
|
+
attr_accessor :Interval
|
9
|
+
|
10
|
+
# Data da primeira cobran�a
|
11
|
+
attr_accessor :DateToStartBilling
|
12
|
+
|
13
|
+
# Total de recorr�ncias
|
14
|
+
attr_accessor :Recurrences
|
15
|
+
|
16
|
+
# Informa se ser� necess�rio efetuar o procedimento OneDollarAuth antes de registrar a recorr�ncia
|
17
|
+
attr_accessor :OneDollarAuth
|
18
|
+
|
19
|
+
def to_json
|
20
|
+
hash = {}
|
21
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
22
|
+
hash
|
23
|
+
end
|
24
|
+
end
|
25
25
|
end
|
@@ -1,38 +1,38 @@
|
|
1
|
-
module Gateway
|
2
|
-
|
3
|
-
class CreateSaleRequest
|
4
|
-
|
5
|
-
attr_accessor :CreditCardTransactionCollection
|
6
|
-
|
7
|
-
attr_accessor :BoletoTransactionCollection
|
8
|
-
|
9
|
-
attr_accessor :Order
|
10
|
-
|
11
|
-
attr_accessor :Buyer
|
12
|
-
|
13
|
-
attr_accessor :ShoppingCartCollection
|
14
|
-
|
15
|
-
attr_accessor :Options
|
16
|
-
|
17
|
-
attr_accessor :Merchant
|
18
|
-
|
19
|
-
attr_accessor :RequestData
|
20
|
-
|
21
|
-
def initialize
|
22
|
-
@CreditCardTransactionCollection = Array.new
|
23
|
-
@BoletoTransactionCollection = Array.new
|
24
|
-
@ShoppingCartCollection = Array.new
|
25
|
-
@Buyer = Buyer.new
|
26
|
-
@RequestData = RequestData.new
|
27
|
-
@Options = SalesOption.new
|
28
|
-
@Merchant = Merchant.new
|
29
|
-
@Order = Order.new
|
30
|
-
end
|
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
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class CreateSaleRequest
|
4
|
+
|
5
|
+
attr_accessor :CreditCardTransactionCollection
|
6
|
+
|
7
|
+
attr_accessor :BoletoTransactionCollection
|
8
|
+
|
9
|
+
attr_accessor :Order
|
10
|
+
|
11
|
+
attr_accessor :Buyer
|
12
|
+
|
13
|
+
attr_accessor :ShoppingCartCollection
|
14
|
+
|
15
|
+
attr_accessor :Options
|
16
|
+
|
17
|
+
attr_accessor :Merchant
|
18
|
+
|
19
|
+
attr_accessor :RequestData
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
@CreditCardTransactionCollection = Array.new
|
23
|
+
@BoletoTransactionCollection = Array.new
|
24
|
+
@ShoppingCartCollection = Array.new
|
25
|
+
@Buyer = Buyer.new
|
26
|
+
@RequestData = RequestData.new
|
27
|
+
@Options = SalesOption.new
|
28
|
+
@Merchant = Merchant.new
|
29
|
+
@Order = Order.new
|
30
|
+
end
|
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
|
+
end
|
38
38
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module Gateway
|
2
|
-
|
3
|
-
class ManageSaleRequest
|
4
|
-
|
5
|
-
attr_accessor :CreditCardTransactionCollection
|
6
|
-
|
7
|
-
attr_accessor :OrderKey
|
8
|
-
|
9
|
-
def initialize
|
10
|
-
@CreditCardTransactionCollection = Array.new;
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_json
|
14
|
-
hash = {}
|
15
|
-
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
16
|
-
hash
|
17
|
-
end
|
18
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class ManageSaleRequest
|
4
|
+
|
5
|
+
attr_accessor :CreditCardTransactionCollection
|
6
|
+
|
7
|
+
attr_accessor :OrderKey
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@CreditCardTransactionCollection = Array.new;
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_json
|
14
|
+
hash = {}
|
15
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
16
|
+
hash
|
17
|
+
end
|
18
|
+
end
|
19
19
|
end
|
@@ -1,38 +1,38 @@
|
|
1
|
-
module Gateway
|
2
|
-
|
3
|
-
class QuerySaleRequest
|
4
|
-
attr_accessor :OrderKey
|
5
|
-
|
6
|
-
attr_accessor :OrderReference
|
7
|
-
|
8
|
-
attr_accessor :CreditCardTransactionKey
|
9
|
-
|
10
|
-
attr_accessor :CreditCardTransactionReference
|
11
|
-
|
12
|
-
attr_accessor :BoletoTransactionKey
|
13
|
-
|
14
|
-
attr_accessor :BoletoTransactionReference
|
15
|
-
|
16
|
-
attr_accessor :QuerySaleRequestEnum
|
17
|
-
|
18
|
-
# Enum feito para as chamadas do m�todo query
|
19
|
-
@@QuerySaleRequestEnum = {
|
20
|
-
:OrderKey => 'OrderKey',
|
21
|
-
:OrderReference => 'OrderReference',
|
22
|
-
:CreditCardTransactionKey => 'CreditCardTransactionKey',
|
23
|
-
:CreditCardTransactionReference => 'CreditCardTransactionReference',
|
24
|
-
:BoletoTransactionKey => 'BoletoTransactionKey',
|
25
|
-
:BoletoTransactionReference => 'BoletoTransactionReference'
|
26
|
-
}
|
27
|
-
|
28
|
-
def self.QuerySaleRequestEnum
|
29
|
-
@@QuerySaleRequestEnum
|
30
|
-
end
|
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
|
-
end
|
1
|
+
module Gateway
|
2
|
+
|
3
|
+
class QuerySaleRequest
|
4
|
+
attr_accessor :OrderKey
|
5
|
+
|
6
|
+
attr_accessor :OrderReference
|
7
|
+
|
8
|
+
attr_accessor :CreditCardTransactionKey
|
9
|
+
|
10
|
+
attr_accessor :CreditCardTransactionReference
|
11
|
+
|
12
|
+
attr_accessor :BoletoTransactionKey
|
13
|
+
|
14
|
+
attr_accessor :BoletoTransactionReference
|
15
|
+
|
16
|
+
attr_accessor :QuerySaleRequestEnum
|
17
|
+
|
18
|
+
# Enum feito para as chamadas do m�todo query
|
19
|
+
@@QuerySaleRequestEnum = {
|
20
|
+
:OrderKey => 'OrderKey',
|
21
|
+
:OrderReference => 'OrderReference',
|
22
|
+
:CreditCardTransactionKey => 'CreditCardTransactionKey',
|
23
|
+
:CreditCardTransactionReference => 'CreditCardTransactionReference',
|
24
|
+
:BoletoTransactionKey => 'BoletoTransactionKey',
|
25
|
+
:BoletoTransactionReference => 'BoletoTransactionReference'
|
26
|
+
}
|
27
|
+
|
28
|
+
def self.QuerySaleRequestEnum
|
29
|
+
@@QuerySaleRequestEnum
|
30
|
+
end
|
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
|
+
end
|
38
38
|
end
|