mundipagg_sdk 1.0.2 → 1.0.3
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 +4 -4
- data/README.md +61 -61
- data/lib/gateway/Address/billing_address.rb +32 -32
- data/lib/gateway/Address/buyer_address.rb +36 -36
- data/lib/gateway/Address/delivery_address.rb +32 -32
- data/lib/gateway/AntiFraud/anti_fraud_analysis_result.rb +47 -47
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb +51 -51
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +41 -41
- data/lib/gateway/BaseRequest.rb +10 -10
- data/lib/gateway/BaseResponse.rb +17 -17
- data/lib/gateway/BoletoTransaction/boleto_transaction.rb +43 -43
- data/lib/gateway/BoletoTransaction/boleto_transaction_data.rb +43 -43
- data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +14 -14
- data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +19 -19
- data/lib/gateway/BoletoTransaction/boleto_transaction_result.rb +34 -34
- data/lib/gateway/CreditCardTransaction/credit_card.rb +29 -29
- data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +31 -31
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb +103 -103
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +26 -26
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +28 -28
- data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +11 -11
- data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +12 -12
- data/lib/gateway/ErrorItem.rb +17 -17
- data/lib/gateway/ErrorReport.rb +18 -18
- data/lib/gateway/Gateway.rb +441 -444
- data/lib/gateway/InstantBuy/credit_card_data.rb +40 -40
- data/lib/gateway/InstantBuy/get_instant_buy_data_response.rb +17 -17
- data/lib/gateway/Merchant/merchant.rb +10 -10
- data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +17 -17
- data/lib/gateway/Order/order.rb +10 -10
- data/lib/gateway/Order/order_transaction_report_file.rb +5 -5
- data/lib/gateway/Parsers/boleto_transaction_parser.rb +30 -30
- data/lib/gateway/Parsers/credit_card_transaction_parser.rb +39 -39
- data/lib/gateway/Parsers/header_parser.rb +13 -13
- data/lib/gateway/Parsers/online_debit_transaction_parser.rb +29 -29
- data/lib/gateway/Parsers/trailer_parser.rb +14 -14
- data/lib/gateway/Person/buyer.rb +32 -32
- data/lib/gateway/Person/person.rb +46 -46
- data/lib/gateway/Recurrency/recurrency.rb +22 -22
- data/lib/gateway/Sale/create_sale_request.rb +35 -35
- data/lib/gateway/Sale/create_sale_response.rb +24 -24
- data/lib/gateway/Sale/manage_sale_request.rb +16 -16
- data/lib/gateway/Sale/manage_sale_response.rb +14 -14
- data/lib/gateway/Sale/query_sale_request.rb +35 -35
- data/lib/gateway/Sale/query_sale_response.rb +17 -17
- data/lib/gateway/Sale/request_data.rb +19 -19
- data/lib/gateway/Sale/retry_sale_options.rb +13 -13
- data/lib/gateway/Sale/retry_sale_request.rb +21 -21
- data/lib/gateway/Sale/retry_sale_response.rb +13 -13
- data/lib/gateway/Sale/sale_data.rb +32 -32
- data/lib/gateway/Sale/sale_order_data.rb +16 -16
- data/lib/gateway/SalesOption.rb +17 -17
- data/lib/gateway/ShoppingCart/shopping_cart.rb +25 -25
- data/lib/gateway/ShoppingCart/shopping_cart_item.rb +22 -22
- data/lib/gateway/Trailer.rb +5 -5
- data/lib/gateway/address.rb +24 -24
- data/lib/gateway/header.rb +4 -4
- data/lib/gateway/post_notification.rb +28 -28
- data/lib/gateway/transaction_report_file.rb +44 -44
- data/lib/mundipagg_sdk.rb +70 -70
- data/mundipagg_sdk.gemspec +18 -18
- data/spec/integration/gateway_spec.rb +733 -651
- data/spec/integration/test_helper.rb +68 -68
- metadata +2 -2
@@ -1,41 +1,41 @@
|
|
1
|
-
class QuerySaleAntiFraudAnalysisHistoryData
|
2
|
-
# Status do antifraude
|
3
|
-
attr_accessor :AntiFraudAnalysisStatus
|
4
|
-
|
5
|
-
@@AntiFraudAnalysisStatusEnum = {
|
6
|
-
:Undefined => '0',
|
7
|
-
:PendingFraudAnalysisRequirement => '1',
|
8
|
-
:FraudAnalysisRequirementSent => '2',
|
9
|
-
:Approved => '3',
|
10
|
-
:Reproved => '4',
|
11
|
-
:PendingManualAnalysis => '5',
|
12
|
-
:NoTransactionToAnalyse => '6',
|
13
|
-
:FraudAnalysisWithError => '7'
|
14
|
-
}
|
15
|
-
|
16
|
-
# Código de retorno do serviço de anti fraude
|
17
|
-
attr_accessor :ReturnCode
|
18
|
-
|
19
|
-
# Status de retorno
|
20
|
-
attr_accessor :ReturnStatus
|
21
|
-
|
22
|
-
# Menssagem de retorno
|
23
|
-
attr_accessor :ReturnMessage
|
24
|
-
|
25
|
-
# Pontuação
|
26
|
-
attr_accessor :Score
|
27
|
-
|
28
|
-
# Data da alteração de status
|
29
|
-
attr_accessor :StatusChangedDate
|
30
|
-
|
31
|
-
def initialize
|
32
|
-
@AntiFraudAnalysisStatus = self.AntiFraudAnalysisStatusEnum
|
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
|
-
|
41
|
-
end
|
1
|
+
class QuerySaleAntiFraudAnalysisHistoryData
|
2
|
+
# Status do antifraude
|
3
|
+
attr_accessor :AntiFraudAnalysisStatus
|
4
|
+
|
5
|
+
@@AntiFraudAnalysisStatusEnum = {
|
6
|
+
:Undefined => '0',
|
7
|
+
:PendingFraudAnalysisRequirement => '1',
|
8
|
+
:FraudAnalysisRequirementSent => '2',
|
9
|
+
:Approved => '3',
|
10
|
+
:Reproved => '4',
|
11
|
+
:PendingManualAnalysis => '5',
|
12
|
+
:NoTransactionToAnalyse => '6',
|
13
|
+
:FraudAnalysisWithError => '7'
|
14
|
+
}
|
15
|
+
|
16
|
+
# Código de retorno do serviço de anti fraude
|
17
|
+
attr_accessor :ReturnCode
|
18
|
+
|
19
|
+
# Status de retorno
|
20
|
+
attr_accessor :ReturnStatus
|
21
|
+
|
22
|
+
# Menssagem de retorno
|
23
|
+
attr_accessor :ReturnMessage
|
24
|
+
|
25
|
+
# Pontuação
|
26
|
+
attr_accessor :Score
|
27
|
+
|
28
|
+
# Data da alteração de status
|
29
|
+
attr_accessor :StatusChangedDate
|
30
|
+
|
31
|
+
def initialize
|
32
|
+
@AntiFraudAnalysisStatus = self.AntiFraudAnalysisStatusEnum
|
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
|
+
|
41
|
+
end
|
data/lib/gateway/BaseRequest.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
class BaseRequest
|
2
|
-
# Chave da requisi��o. Utilizada para identificar uma requisi��o espec�fica no gateway.
|
3
|
-
attr_accessor :RequestKey
|
4
|
-
|
5
|
-
def to_json
|
6
|
-
hash = {}
|
7
|
-
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
8
|
-
hash
|
9
|
-
end
|
10
|
-
|
1
|
+
class BaseRequest
|
2
|
+
# Chave da requisi��o. Utilizada para identificar uma requisi��o espec�fica no gateway.
|
3
|
+
attr_accessor :RequestKey
|
4
|
+
|
5
|
+
def to_json
|
6
|
+
hash = {}
|
7
|
+
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
8
|
+
hash
|
9
|
+
end
|
10
|
+
|
11
11
|
end
|
data/lib/gateway/BaseResponse.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
class BaseResponse
|
2
|
-
|
3
|
-
attr_accessor :RequestKey
|
4
|
-
|
5
|
-
attr_accessor :MerchantKey
|
6
|
-
|
7
|
-
attr_accessor :ErrorReport
|
8
|
-
|
9
|
-
attr_accessor :InternalTime
|
10
|
-
|
11
|
-
def to_json
|
12
|
-
hash = {}
|
13
|
-
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
14
|
-
hash
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
1
|
+
class BaseResponse
|
2
|
+
|
3
|
+
attr_accessor :RequestKey
|
4
|
+
|
5
|
+
attr_accessor :MerchantKey
|
6
|
+
|
7
|
+
attr_accessor :ErrorReport
|
8
|
+
|
9
|
+
attr_accessor :InternalTime
|
10
|
+
|
11
|
+
def to_json
|
12
|
+
hash = {}
|
13
|
+
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
14
|
+
hash
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -1,43 +1,43 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
class BoletoTransaction
|
4
|
-
|
5
|
-
# Valor do boleto em centavos
|
6
|
-
attr_accessor :AmountInCents
|
7
|
-
|
8
|
-
# Número do banco
|
9
|
-
attr_accessor :BankNumber
|
10
|
-
|
11
|
-
# Instruções a serem impressas no boleto
|
12
|
-
attr_accessor :Instructions
|
13
|
-
|
14
|
-
# Número do documento
|
15
|
-
attr_accessor :DocumentNumber
|
16
|
-
|
17
|
-
# Indentificador da transação no sistema da loja
|
18
|
-
attr_accessor :TransactionReference
|
19
|
-
|
20
|
-
# Data da criação da transação no sistema da loja
|
21
|
-
attr_accessor :TransactionDateInMerchant
|
22
|
-
|
23
|
-
# Opções da transação de boleto
|
24
|
-
attr_accessor :Options
|
25
|
-
|
26
|
-
# Endereço de cobrança
|
27
|
-
attr_accessor :BillingAddress
|
28
|
-
|
29
|
-
def initialize
|
30
|
-
@Options = BoletoTransactionOptions.new
|
31
|
-
@BillingAddress = BillingAddress.new
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
def to_json
|
36
|
-
hash = {}
|
37
|
-
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
38
|
-
hash
|
39
|
-
|
40
|
-
#JSON.pretty_generate(hash)
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
class BoletoTransaction
|
4
|
+
|
5
|
+
# Valor do boleto em centavos
|
6
|
+
attr_accessor :AmountInCents
|
7
|
+
|
8
|
+
# Número do banco
|
9
|
+
attr_accessor :BankNumber
|
10
|
+
|
11
|
+
# Instruções a serem impressas no boleto
|
12
|
+
attr_accessor :Instructions
|
13
|
+
|
14
|
+
# Número do documento
|
15
|
+
attr_accessor :DocumentNumber
|
16
|
+
|
17
|
+
# Indentificador da transação no sistema da loja
|
18
|
+
attr_accessor :TransactionReference
|
19
|
+
|
20
|
+
# Data da criação da transação no sistema da loja
|
21
|
+
attr_accessor :TransactionDateInMerchant
|
22
|
+
|
23
|
+
# Opções da transação de boleto
|
24
|
+
attr_accessor :Options
|
25
|
+
|
26
|
+
# Endereço de cobrança
|
27
|
+
attr_accessor :BillingAddress
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
@Options = BoletoTransactionOptions.new
|
31
|
+
@BillingAddress = BillingAddress.new
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def to_json
|
36
|
+
hash = {}
|
37
|
+
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
38
|
+
hash
|
39
|
+
|
40
|
+
#JSON.pretty_generate(hash)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -1,44 +1,44 @@
|
|
1
|
-
class BoletoTransactionData
|
2
|
-
# Url para visualiza��o do boleto
|
3
|
-
attr_accessor :BoletoUrl
|
4
|
-
|
5
|
-
# C�digo de barras do boleto
|
6
|
-
attr_accessor :Barcode
|
7
|
-
|
8
|
-
# Status do boleto
|
9
|
-
attr_accessor :BoletoTransactionStatus
|
10
|
-
|
11
|
-
# Chave da transa��o. Utilizada para identificar a transa��o de boleto no gateway
|
12
|
-
attr_accessor :TransactionKey
|
13
|
-
|
14
|
-
# Valor original do boleto em centavos
|
15
|
-
attr_accessor :AmountInCents
|
16
|
-
|
17
|
-
# N�mero do documento
|
18
|
-
attr_accessor :DocumentNumber
|
19
|
-
|
20
|
-
# Identificador da transa��o no sistema da loja
|
21
|
-
attr_accessor :TransactionReference
|
22
|
-
|
23
|
-
# Data de expira��o do boleto
|
24
|
-
attr_accessor :ExpirationDate
|
25
|
-
|
26
|
-
# N�mero do banco
|
27
|
-
attr_accessor :BankNumber
|
28
|
-
|
29
|
-
# Valor total pago em centavos
|
30
|
-
attr_accessor :AmountPaidInCents
|
31
|
-
|
32
|
-
# Data de cria��o do boleto no gateway
|
33
|
-
attr_accessor :CreateDate
|
34
|
-
|
35
|
-
# Identificador do boleto
|
36
|
-
attr_accessor :NossoNumero
|
37
|
-
|
38
|
-
def to_json
|
39
|
-
hash = {}
|
40
|
-
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
41
|
-
hash
|
42
|
-
end
|
43
|
-
|
1
|
+
class BoletoTransactionData
|
2
|
+
# Url para visualiza��o do boleto
|
3
|
+
attr_accessor :BoletoUrl
|
4
|
+
|
5
|
+
# C�digo de barras do boleto
|
6
|
+
attr_accessor :Barcode
|
7
|
+
|
8
|
+
# Status do boleto
|
9
|
+
attr_accessor :BoletoTransactionStatus
|
10
|
+
|
11
|
+
# Chave da transa��o. Utilizada para identificar a transa��o de boleto no gateway
|
12
|
+
attr_accessor :TransactionKey
|
13
|
+
|
14
|
+
# Valor original do boleto em centavos
|
15
|
+
attr_accessor :AmountInCents
|
16
|
+
|
17
|
+
# N�mero do documento
|
18
|
+
attr_accessor :DocumentNumber
|
19
|
+
|
20
|
+
# Identificador da transa��o no sistema da loja
|
21
|
+
attr_accessor :TransactionReference
|
22
|
+
|
23
|
+
# Data de expira��o do boleto
|
24
|
+
attr_accessor :ExpirationDate
|
25
|
+
|
26
|
+
# N�mero do banco
|
27
|
+
attr_accessor :BankNumber
|
28
|
+
|
29
|
+
# Valor total pago em centavos
|
30
|
+
attr_accessor :AmountPaidInCents
|
31
|
+
|
32
|
+
# Data de cria��o do boleto no gateway
|
33
|
+
attr_accessor :CreateDate
|
34
|
+
|
35
|
+
# Identificador do boleto
|
36
|
+
attr_accessor :NossoNumero
|
37
|
+
|
38
|
+
def to_json
|
39
|
+
hash = {}
|
40
|
+
instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
41
|
+
hash
|
42
|
+
end
|
43
|
+
|
44
44
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
class BoletoTransactionOptions
|
2
|
-
# Total de dias para expirar o boleto
|
3
|
-
attr_accessor :DaysToAddInBoletoExpirationDate
|
4
|
-
|
5
|
-
# Moeda. Opções: BRL, EUR, USD, ARS, BOB, CLP, COP, UYU, MXN, PYG
|
6
|
-
attr_accessor :CurrencyIso
|
7
|
-
|
8
|
-
def to_json
|
9
|
-
hash = {}
|
10
|
-
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
11
|
-
hash
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
1
|
+
class BoletoTransactionOptions
|
2
|
+
# Total de dias para expirar o boleto
|
3
|
+
attr_accessor :DaysToAddInBoletoExpirationDate
|
4
|
+
|
5
|
+
# Moeda. Opções: BRL, EUR, USD, ARS, BOB, CLP, COP, UYU, MXN, PYG
|
6
|
+
attr_accessor :CurrencyIso
|
7
|
+
|
8
|
+
def to_json
|
9
|
+
hash = {}
|
10
|
+
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
11
|
+
hash
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
class BoletoTransactionReportFile
|
2
|
-
attr_accessor :Order
|
3
|
-
attr_accessor :TransactionKey
|
4
|
-
attr_accessor :TransactionReference
|
5
|
-
attr_accessor :Status
|
6
|
-
attr_accessor :NossoNumero
|
7
|
-
attr_accessor :BankNumber
|
8
|
-
attr_accessor :Agency
|
9
|
-
attr_accessor :Account
|
10
|
-
attr_accessor :BarCode
|
11
|
-
attr_accessor :ExpirationDate
|
12
|
-
attr_accessor :AmountInCents
|
13
|
-
attr_accessor :AmountPaidInCents
|
14
|
-
attr_accessor :PaymentDate
|
15
|
-
attr_accessor :CreditDate
|
16
|
-
|
17
|
-
def initialize
|
18
|
-
@Order = OrderTransactionReportFile.new
|
19
|
-
end
|
1
|
+
class BoletoTransactionReportFile
|
2
|
+
attr_accessor :Order
|
3
|
+
attr_accessor :TransactionKey
|
4
|
+
attr_accessor :TransactionReference
|
5
|
+
attr_accessor :Status
|
6
|
+
attr_accessor :NossoNumero
|
7
|
+
attr_accessor :BankNumber
|
8
|
+
attr_accessor :Agency
|
9
|
+
attr_accessor :Account
|
10
|
+
attr_accessor :BarCode
|
11
|
+
attr_accessor :ExpirationDate
|
12
|
+
attr_accessor :AmountInCents
|
13
|
+
attr_accessor :AmountPaidInCents
|
14
|
+
attr_accessor :PaymentDate
|
15
|
+
attr_accessor :CreditDate
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
@Order = OrderTransactionReportFile.new
|
19
|
+
end
|
20
20
|
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
class BoletoTransactionResult
|
2
|
-
# Url para visualiza��o do boleto
|
3
|
-
attr_accessor :BoletoUrl
|
4
|
-
|
5
|
-
# C�digo de barras
|
6
|
-
attr_accessor :Barcode
|
7
|
-
|
8
|
-
# Status do boleto
|
9
|
-
attr_accessor :BoletoTransactionStatus
|
10
|
-
|
11
|
-
# Chave da transa��o. Utilizada para identificar a transa��o de boleto no gateway
|
12
|
-
attr_accessor :TransactionKey
|
13
|
-
|
14
|
-
# Valor original da transa��o em centavos
|
15
|
-
attr_accessor :AmountInCents
|
16
|
-
|
17
|
-
# N�mero do documento
|
18
|
-
attr_accessor :DocumentNumber
|
19
|
-
|
20
|
-
# Identificador da transa��o no sistema da loja
|
21
|
-
attr_accessor :TransactionReference
|
22
|
-
|
23
|
-
# Indica se houve sucesso na gera��o do boleto
|
24
|
-
attr_accessor :Success
|
25
|
-
|
26
|
-
# N�mero de identifica��o do boleto
|
27
|
-
attr_accessor :NossoNumero
|
28
|
-
|
29
|
-
def to_json
|
30
|
-
hash = {}
|
31
|
-
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
32
|
-
hash
|
33
|
-
end
|
34
|
-
|
1
|
+
class BoletoTransactionResult
|
2
|
+
# Url para visualiza��o do boleto
|
3
|
+
attr_accessor :BoletoUrl
|
4
|
+
|
5
|
+
# C�digo de barras
|
6
|
+
attr_accessor :Barcode
|
7
|
+
|
8
|
+
# Status do boleto
|
9
|
+
attr_accessor :BoletoTransactionStatus
|
10
|
+
|
11
|
+
# Chave da transa��o. Utilizada para identificar a transa��o de boleto no gateway
|
12
|
+
attr_accessor :TransactionKey
|
13
|
+
|
14
|
+
# Valor original da transa��o em centavos
|
15
|
+
attr_accessor :AmountInCents
|
16
|
+
|
17
|
+
# N�mero do documento
|
18
|
+
attr_accessor :DocumentNumber
|
19
|
+
|
20
|
+
# Identificador da transa��o no sistema da loja
|
21
|
+
attr_accessor :TransactionReference
|
22
|
+
|
23
|
+
# Indica se houve sucesso na gera��o do boleto
|
24
|
+
attr_accessor :Success
|
25
|
+
|
26
|
+
# N�mero de identifica��o do boleto
|
27
|
+
attr_accessor :NossoNumero
|
28
|
+
|
29
|
+
def to_json
|
30
|
+
hash = {}
|
31
|
+
instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
|
32
|
+
hash
|
33
|
+
end
|
34
|
+
|
35
35
|
end
|