mundipagg_sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +191 -0
  3. data/README.md +63 -0
  4. data/lib/gateway/Address/billing_address.rb +32 -0
  5. data/lib/gateway/Address/buyer_address.rb +36 -0
  6. data/lib/gateway/Address/delivery_address.rb +32 -0
  7. data/lib/gateway/AntiFraud/anti_fraud_analysis_result.rb +47 -0
  8. data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb +51 -0
  9. data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +41 -0
  10. data/lib/gateway/BaseRequest.rb +11 -0
  11. data/lib/gateway/BaseResponse.rb +17 -0
  12. data/lib/gateway/BoletoTransaction/boleto_transaction.rb +43 -0
  13. data/lib/gateway/BoletoTransaction/boleto_transaction_data.rb +44 -0
  14. data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +14 -0
  15. data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +20 -0
  16. data/lib/gateway/BoletoTransaction/boleto_transaction_result.rb +35 -0
  17. data/lib/gateway/CreditCardTransaction/credit_card.rb +30 -0
  18. data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +32 -0
  19. data/lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb +104 -0
  20. data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +27 -0
  21. data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +29 -0
  22. data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +12 -0
  23. data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +13 -0
  24. data/lib/gateway/ErrorItem.rb +17 -0
  25. data/lib/gateway/ErrorReport.rb +18 -0
  26. data/lib/gateway/Gateway.rb +416 -0
  27. data/lib/gateway/InstantBuy/credit_card_data.rb +41 -0
  28. data/lib/gateway/InstantBuy/get_instant_buy_data_response.rb +18 -0
  29. data/lib/gateway/Merchant/merchant.rb +11 -0
  30. data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +18 -0
  31. data/lib/gateway/Order/order.rb +11 -0
  32. data/lib/gateway/Order/order_transaction_report_file.rb +6 -0
  33. data/lib/gateway/Parsers/boleto_transaction_parser.rb +31 -0
  34. data/lib/gateway/Parsers/credit_card_transaction_parser.rb +40 -0
  35. data/lib/gateway/Parsers/header_parser.rb +14 -0
  36. data/lib/gateway/Parsers/online_debit_transaction_parser.rb +30 -0
  37. data/lib/gateway/Parsers/trailer_parser.rb +15 -0
  38. data/lib/gateway/Person/buyer.rb +33 -0
  39. data/lib/gateway/Person/person.rb +47 -0
  40. data/lib/gateway/Recurrency/recurrency.rb +23 -0
  41. data/lib/gateway/Sale/create_sale_request.rb +36 -0
  42. data/lib/gateway/Sale/create_sale_response.rb +25 -0
  43. data/lib/gateway/Sale/manage_sale_request.rb +17 -0
  44. data/lib/gateway/Sale/manage_sale_response.rb +15 -0
  45. data/lib/gateway/Sale/query_sale_request.rb +36 -0
  46. data/lib/gateway/Sale/query_sale_response.rb +18 -0
  47. data/lib/gateway/Sale/request_data.rb +20 -0
  48. data/lib/gateway/Sale/retry_sale_options.rb +14 -0
  49. data/lib/gateway/Sale/retry_sale_request.rb +22 -0
  50. data/lib/gateway/Sale/retry_sale_response.rb +14 -0
  51. data/lib/gateway/Sale/sale_data.rb +33 -0
  52. data/lib/gateway/Sale/sale_order_data.rb +17 -0
  53. data/lib/gateway/SalesOption.rb +17 -0
  54. data/lib/gateway/ShoppingCart/shopping_cart.rb +26 -0
  55. data/lib/gateway/ShoppingCart/shopping_cart_item.rb +23 -0
  56. data/lib/gateway/Trailer.rb +6 -0
  57. data/lib/gateway/address.rb +25 -0
  58. data/lib/gateway/header.rb +5 -0
  59. data/lib/gateway/post_notification.rb +29 -0
  60. data/lib/gateway/transaction_report_file.rb +45 -0
  61. data/lib/mundipagg_sdk.rb +70 -0
  62. data/mundipagg_sdk.gemspec +19 -0
  63. data/spec/integration/gateway_spec.rb +612 -0
  64. data/spec/integration/test_helper.rb +69 -0
  65. data/spec/spec_helper.rb +96 -0
  66. metadata +247 -0
@@ -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 :InstantBuyKey
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
@@ -0,0 +1,32 @@
1
+ class CreditCardTransaction
2
+
3
+ attr_accessor :CreditCard
4
+
5
+ attr_accessor :Options
6
+
7
+ attr_accessor :Recurrency
8
+
9
+ attr_accessor :AmountInCents
10
+
11
+ attr_accessor :InstallmentCount
12
+
13
+ attr_accessor :CreditCardOperation
14
+
15
+ attr_accessor :TransactionReference
16
+
17
+ attr_accessor :TransactionDateInMerchant
18
+
19
+
20
+ def initialize
21
+ @Options = CreditCardTransactionOptions.new
22
+ @Recurrency = Recurrency.new
23
+ @CreditCard = CreditCard.new
24
+ end
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,104 @@
1
+ require_relative '../../gateway/InstantBuy/credit_card_data'
2
+ class CreditCardTransactionData
3
+ # Dados do cart�o de cr�dito
4
+ attr_accessor :CreditCard
5
+
6
+ # Status da transa��o de cart�o de cr�dito
7
+ attr_accessor :CreditCardTransactionStatus
8
+
9
+ @@CreditCardTransactionStatusEnum = {
10
+ :AuthorizedPendingCapture => '1',
11
+ :NotAuthorized => '2',
12
+ :ChargebackPreview => '3',
13
+ :RefundPreview => '4',
14
+ :DepositPreview => '5',
15
+ :Captured => '6',
16
+ :PartialCapture => '7',
17
+ :Refunded => '8',
18
+ :Voided => '9',
19
+ :Deposited => '10',
20
+ :Chargeback => '12',
21
+ :PendingVoid => '13',
22
+ :Invalid => '14',
23
+ :PartialAlthorize => '15',
24
+ :PartialRefunded => '16',
25
+ :OverCapture => '17',
26
+ :PartialVoid => '18',
27
+ :PendingRefund => '19',
28
+ :UnScheduled => '20',
29
+ :Created => '21',
30
+ :PartialAuthorized => '22',
31
+ :NotFoundInAcquirer => '23',
32
+ :PendingAuthorize => '24',
33
+ :WithError => '99'
34
+ }
35
+
36
+ # Chave da transa��o. Utilizada para identificar a transa��o de cart�o de cr�dito no gateway
37
+ attr_accessor :TransactionKey
38
+
39
+ # Identificador da transa��o gerado pela loja.
40
+ attr_accessor :TransactionIdentifier
41
+
42
+ # C�digo de autoriza��o retornado pela adquirente
43
+ attr_accessor :AcquirerAuthorizationCode
44
+
45
+ # Identificador �nico retornado pela adquirente
46
+ attr_accessor :UniqueSequentialNumber
47
+
48
+ # Valor original da transa��o em centavos
49
+ attr_accessor :AmountInCents
50
+
51
+ # Valor autorizado em centavos
52
+ attr_accessor :AuthorizedAmountInCents
53
+
54
+ # Valor capturado em centavos
55
+ attr_accessor :CapturedAmountInCents
56
+
57
+ # Valor estornado em centavos
58
+ attr_accessor :RefundedAmountInCents
59
+
60
+ # Valor cancelado em centavos
61
+ attr_accessor :VoidedAmountInCents
62
+
63
+ # Data da recorr�ncia (poder� ser futura)
64
+ attr_accessor :DueDate
65
+
66
+ # Identificador da transa��o no sistema da loja
67
+ attr_accessor :TransactionReference
68
+
69
+ # Data de cria��o da transa��o no gatewaya
70
+ attr_accessor :CreateDate
71
+
72
+ # Nome da adquirente que processou a transa��o
73
+ attr_accessor :AcquirerName
74
+
75
+ # Indica se � uma recorr�ncia
76
+ attr_accessor :IsRecurrency
77
+
78
+ # Total de parcelas na transa��o
79
+ attr_accessor :InstallmentCount
80
+
81
+ # C�digo de filia��o da loja na adquirente
82
+ attr_accessor :AffiliationCode
83
+
84
+ # C�digo do m�todo de pagamento
85
+ attr_accessor :PaymentMethodName
86
+
87
+ # Chave da transa��o na adquirente, enviada pelo gateway
88
+ attr_accessor :TransactionKeyToAcquirer
89
+
90
+ # Data limite para a captura da transa��o na adquirente
91
+ attr_accessor :CaptureExpirationDate
92
+
93
+ def initialize
94
+ @CreditCard = CreditCardData.new
95
+ @CreditCardTransactionStatus = self.CreditCardTransactionStatusEnum
96
+ end
97
+
98
+ def to_json
99
+ hash = {}
100
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
101
+ hash
102
+ end
103
+
104
+ end
@@ -0,0 +1,27 @@
1
+ class CreditCardTransactionOptions
2
+
3
+ attr_accessor :PaymentMethodCode
4
+
5
+ attr_accessor :CurrencyIso
6
+
7
+ attr_accessor :IataAmountInCents
8
+
9
+ attr_accessor :CaptureDelayInMinutes
10
+
11
+ attr_accessor :MerchantCategoryCode
12
+
13
+ attr_accessor :SoftDescriptorText
14
+
15
+ attr_accessor :InterestRate
16
+
17
+ attr_accessor :ExtendedLimitEnabled
18
+
19
+ attr_accessor :ExtendedLimitCode
20
+
21
+ def to_json
22
+ hash = {}
23
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
24
+ hash
25
+ end
26
+
27
+ end
@@ -0,0 +1,29 @@
1
+ class CreditCardTransactionReportFile
2
+ attr_accessor :Order
3
+ attr_accessor :TransactionKey
4
+ attr_accessor :TransactionKeyToAcquirer
5
+ attr_accessor :CreditCardTransactionReference
6
+ attr_accessor :CreditCardBrand
7
+ attr_accessor :CreditCardNumber
8
+ attr_accessor :InstallmentCount
9
+ attr_accessor :AcquirerName
10
+ attr_accessor :Status
11
+ attr_accessor :AmountInCents
12
+ attr_accessor :IataAmountInCents
13
+ attr_accessor :AuthorizationCode
14
+ attr_accessor :TransactionIdentifier
15
+ attr_accessor :UniqueSequentialNumber
16
+ attr_accessor :AuthorizedAmountInCents
17
+ attr_accessor :CapturedAmountInCents
18
+ attr_accessor :VoidedAmountInCents
19
+ attr_accessor :RefundedAmountInCents
20
+ attr_accessor :AcquirerAuthorizationReturnCode
21
+ attr_accessor :AuthorizedDate
22
+ attr_accessor :CapturedDate
23
+ attr_accessor :VoidedDate
24
+ attr_accessor :LastProbeDate
25
+
26
+ def initialize
27
+ @Order = OrderTransactionReportFile.new
28
+ end
29
+ end