mundipagg_api 1.0.0

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.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +191 -0
  3. data/README.md +308 -0
  4. data/lib/mundipagg/Address/billing_address.rb +32 -0
  5. data/lib/mundipagg/Address/buyer_address.rb +36 -0
  6. data/lib/mundipagg/Address/delivery_address.rb +32 -0
  7. data/lib/mundipagg/AntiFraud/anti_fraud_analysis_result.rb +47 -0
  8. data/lib/mundipagg/AntiFraud/query_sale_anti_fraud_analysis_data.rb +51 -0
  9. data/lib/mundipagg/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +41 -0
  10. data/lib/mundipagg/BaseRequest.rb +11 -0
  11. data/lib/mundipagg/BaseResponse.rb +17 -0
  12. data/lib/mundipagg/BoletoTransaction/boleto_transaction.rb +43 -0
  13. data/lib/mundipagg/BoletoTransaction/boleto_transaction_data.rb +44 -0
  14. data/lib/mundipagg/BoletoTransaction/boleto_transaction_options.rb +14 -0
  15. data/lib/mundipagg/BoletoTransaction/boleto_transaction_report_file.rb +20 -0
  16. data/lib/mundipagg/BoletoTransaction/boleto_transaction_result.rb +35 -0
  17. data/lib/mundipagg/CreditCardTransaction/credit_card.rb +30 -0
  18. data/lib/mundipagg/CreditCardTransaction/credit_card_transaction.rb +32 -0
  19. data/lib/mundipagg/CreditCardTransaction/credit_card_transaction_data.rb +104 -0
  20. data/lib/mundipagg/CreditCardTransaction/credit_card_transaction_options.rb +27 -0
  21. data/lib/mundipagg/CreditCardTransaction/credit_card_transaction_report_file.rb +29 -0
  22. data/lib/mundipagg/CreditCardTransaction/manage_credit_card_transaction.rb +12 -0
  23. data/lib/mundipagg/CreditCardTransaction/retry_sale_credit_card_transaction.rb +13 -0
  24. data/lib/mundipagg/ErrorItem.rb +17 -0
  25. data/lib/mundipagg/ErrorReport.rb +18 -0
  26. data/lib/mundipagg/InstantBuy/credit_card_data.rb +41 -0
  27. data/lib/mundipagg/InstantBuy/get_instant_buy_data_response.rb +18 -0
  28. data/lib/mundipagg/Merchant/merchant.rb +11 -0
  29. data/lib/mundipagg/MundipaggApi.rb +336 -0
  30. data/lib/mundipagg/OnlineDebit/online_debit_transaction_report_file.rb +18 -0
  31. data/lib/mundipagg/Order/order.rb +11 -0
  32. data/lib/mundipagg/Order/order_transaction_report_file.rb +6 -0
  33. data/lib/mundipagg/Parsers/boleto_transaction_parser.rb +31 -0
  34. data/lib/mundipagg/Parsers/credit_card_transaction_parser.rb +40 -0
  35. data/lib/mundipagg/Parsers/header_parser.rb +14 -0
  36. data/lib/mundipagg/Parsers/online_debit_transaction_parser.rb +30 -0
  37. data/lib/mundipagg/Parsers/trailer_parser.rb +15 -0
  38. data/lib/mundipagg/Person/buyer.rb +33 -0
  39. data/lib/mundipagg/Person/person.rb +47 -0
  40. data/lib/mundipagg/Recurrency/recurrency.rb +23 -0
  41. data/lib/mundipagg/Sale/create_sale_request.rb +36 -0
  42. data/lib/mundipagg/Sale/create_sale_response.rb +25 -0
  43. data/lib/mundipagg/Sale/manage_sale_request.rb +17 -0
  44. data/lib/mundipagg/Sale/manage_sale_response.rb +15 -0
  45. data/lib/mundipagg/Sale/query_sale_request.rb +36 -0
  46. data/lib/mundipagg/Sale/query_sale_response.rb +18 -0
  47. data/lib/mundipagg/Sale/request_data.rb +20 -0
  48. data/lib/mundipagg/Sale/retry_sale_options.rb +14 -0
  49. data/lib/mundipagg/Sale/retry_sale_request.rb +22 -0
  50. data/lib/mundipagg/Sale/retry_sale_response.rb +14 -0
  51. data/lib/mundipagg/Sale/sale_data.rb +33 -0
  52. data/lib/mundipagg/Sale/sale_order_data.rb +17 -0
  53. data/lib/mundipagg/SalesOption.rb +17 -0
  54. data/lib/mundipagg/ShoppingCart/shopping_cart.rb +26 -0
  55. data/lib/mundipagg/ShoppingCart/shopping_cart_item.rb +23 -0
  56. data/lib/mundipagg/Trailer.rb +6 -0
  57. data/lib/mundipagg/address.rb +25 -0
  58. data/lib/mundipagg/header.rb +5 -0
  59. data/lib/mundipagg/post_notification.rb +29 -0
  60. data/lib/mundipagg/transaction_report_file.rb +45 -0
  61. data/lib/mundipagg_api.rb +70 -0
  62. data/mundipagg-api.gemspec +18 -0
  63. data/spec/integration/gateway_spec.rb +521 -0
  64. data/spec/integration/test_helper.rb +69 -0
  65. data/spec/spec_helper.rb +96 -0
  66. metadata +227 -0
@@ -0,0 +1,32 @@
1
+ class BillingAddress
2
+ # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
3
+ attr_accessor :Country
4
+
5
+ # Estado
6
+ attr_accessor :State
7
+
8
+ # Cidade
9
+ attr_accessor :City
10
+
11
+ # Distrito
12
+ attr_accessor :District
13
+
14
+ # Logradouro
15
+ attr_accessor :Street
16
+
17
+ # Número
18
+ attr_accessor :Number
19
+
20
+ # Complemento
21
+ attr_accessor :Complement
22
+
23
+ # CEP
24
+ attr_accessor :ZipCode
25
+
26
+ def to_json
27
+ hash = {}
28
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
29
+ hash
30
+ end
31
+
32
+ end
@@ -0,0 +1,36 @@
1
+ class BuyerAddress
2
+ # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
3
+ attr_accessor :Country
4
+
5
+ # Estado
6
+ attr_accessor :State
7
+
8
+ # Cidade
9
+ attr_accessor :City
10
+
11
+ # Distrito
12
+ attr_accessor :District
13
+
14
+ # Logradouro
15
+ attr_accessor :Street
16
+
17
+ # Número
18
+ attr_accessor :Number
19
+
20
+ # Complemento
21
+ attr_accessor :Complement
22
+
23
+ # CEP
24
+ attr_accessor :ZipCode
25
+
26
+ # Tipo de endereço
27
+ attr_accessor :AddressType
28
+
29
+
30
+ def to_json
31
+ hash = {}
32
+ instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
33
+ hash
34
+ end
35
+
36
+ end
@@ -0,0 +1,32 @@
1
+ class DeliveryAddress
2
+ # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
3
+ attr_accessor :Country
4
+
5
+ # Estado
6
+ attr_accessor :State
7
+
8
+ # Cidade
9
+ attr_accessor :City
10
+
11
+ # Distrito
12
+ attr_accessor :District
13
+
14
+ # Logradouro
15
+ attr_accessor :Street
16
+
17
+ # Número
18
+ attr_accessor :Number
19
+
20
+ # Complemento
21
+ attr_accessor :Complement
22
+
23
+ # zip code
24
+ attr_accessor :ZipCode
25
+
26
+ def to_json
27
+ hash = {}
28
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
29
+ hash
30
+ end
31
+
32
+ end
@@ -0,0 +1,47 @@
1
+ class AntiFraudAnalysisResult
2
+ # Indica se a análise de antifraude está habilitada
3
+ attr_accessor :IsAntiFraudEnabled
4
+
5
+ # Código do serviço de antifraude
6
+ attr_accessor :AntiFraudServiceCode
7
+
8
+ # Status da análise do serviço de antifraude
9
+ attr_accessor :AntiFraudAnalysisStatus
10
+
11
+ # Código de retorno do antifraude
12
+ attr_accessor :ReturnCode
13
+
14
+ # Status de retorno do antifraude
15
+ attr_accessor :ReturnStatus
16
+
17
+ # Mensagem de retorno do antifraude
18
+ attr_accessor :Message
19
+
20
+ # Pontuação do pedido
21
+ attr_accessor :Score
22
+
23
+ # Nome do serviço de antifraude
24
+ attr_accessor :AntiFraudServiceName
25
+
26
+ @@AntiFraudAnalysisStatusEnum = {
27
+ :Undefined => '0',
28
+ :PendingFraudAnalysisRequirement => '1',
29
+ :FraudAnalysisRequirementSent => '2',
30
+ :Approved => '3',
31
+ :Reproved => '4',
32
+ :PendingManualAnalysis => '5',
33
+ :NoTransactionToAnalyse => '6',
34
+ :FraudAnalysisWithError => '7'
35
+ }
36
+
37
+ def initialize
38
+ @AntiFraudAnalysisStatus = self.AntiFraudAnalysisStatusEnum
39
+ end
40
+
41
+ def to_json
42
+ hash = {}
43
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
44
+ hash
45
+ end
46
+
47
+ end
@@ -0,0 +1,51 @@
1
+ class QuerySaleAntiFraudAnalysisData
2
+ # Indica se o serviço de antifraude está habilitado
3
+ attr_accessor :IsAntiFraudEnabled
4
+
5
+ # Código do serviço de antifraude
6
+ attr_accessor :AntiFraudServiceCode
7
+
8
+ # Nome do serviço de antifraude
9
+ attr_accessor :AntiFraudServiceName
10
+
11
+ # Status da análise de antifraude
12
+ attr_accessor :AntiFraudAnalysisStatus
13
+
14
+ @@AntiFraudAnalysisStatus = {
15
+ :Undefined => '0',
16
+ :PendingFraudAnalysisRequirement => '1',
17
+ :FraudAnalysisRequirementSent => '2',
18
+ :Approved => '3',
19
+ :Reproved => '4',
20
+ :PendingManualAnalysis => '5',
21
+ :NoTransactionToAnalyse => '6',
22
+ :FraudAnalysisWithError => '7'
23
+ }
24
+
25
+ # Código de retorno do serviço de antifraude
26
+ attr_accessor :ReturnCode
27
+
28
+ # Status do retorno do antifraude
29
+ attr_accessor :ReturnStatus
30
+
31
+ # Mensagem de retorno do antifraude
32
+ attr_accessor :ReturnMessage
33
+
34
+ # Pontuação do comprador
35
+ attr_accessor :Score
36
+
37
+ # Histórico da análise de antifraude
38
+ attr_accessor :HistoryCollection
39
+
40
+ def initialize
41
+ @AntiFraudAnalysisStatus = self.AntiFraudAnalysisStatusEnum
42
+ @HistoryCollection = QuerySaleAntiFraudAnalysisHistoryData.new
43
+ end
44
+
45
+ def to_json
46
+ hash = {}
47
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
48
+ hash
49
+ end
50
+
51
+ end
@@ -0,0 +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
@@ -0,0 +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
+
11
+ end
@@ -0,0 +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
@@ -0,0 +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
@@ -0,0 +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
+
44
+ end
@@ -0,0 +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
@@ -0,0 +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
20
+ end
@@ -0,0 +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
+
35
+ end
@@ -0,0 +1,30 @@
1
+ class CreditCard
2
+
3
+ attr_accessor :InstantBuyerKey
4
+
5
+ attr_accessor :CreditCardNumber
6
+
7
+ attr_accessor :HolderName
8
+
9
+ attr_accessor :SecurityCode
10
+
11
+ attr_accessor :ExpMonth
12
+
13
+ attr_accessor :ExpYear
14
+
15
+ attr_accessor :CreditCardBrand
16
+
17
+ attr_accessor :BillingAddress
18
+
19
+ def initialize
20
+ @BillingAddress = BillingAddress.new
21
+ end
22
+
23
+ def to_json
24
+ hash = {}
25
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
26
+ hash
27
+ end
28
+
29
+
30
+ end