mundipagg_sdk 1.3.0 → 1.4.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 (52) hide show
  1. checksums.yaml +13 -5
  2. data/LICENSE +190 -190
  3. data/README.md +61 -61
  4. data/lib/gateway/Address/billing_address.rb +33 -33
  5. data/lib/gateway/Address/buyer_address.rb +38 -38
  6. data/lib/gateway/Address/delivery_address.rb +34 -34
  7. data/lib/gateway/BoletoTransaction/boleto_transaction.rb +40 -40
  8. data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +16 -16
  9. data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +22 -22
  10. data/lib/gateway/CreditCardTransaction/credit_card.rb +30 -30
  11. data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +33 -33
  12. data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +28 -28
  13. data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +31 -31
  14. data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +14 -14
  15. data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +14 -14
  16. data/lib/gateway/Gateway.rb +525 -627
  17. data/lib/gateway/InstantBuyData/create_instant_buy_data_request.rb +30 -30
  18. data/lib/gateway/InstantBuyData/update_instant_buy_data_request.rb +10 -10
  19. data/lib/gateway/Merchant/merchant.rb +12 -12
  20. data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +21 -21
  21. data/lib/gateway/Order/order.rb +13 -13
  22. data/lib/gateway/Order/order_transaction_report_file.rb +8 -8
  23. data/lib/gateway/Parsers/boleto_transaction_parser.rb +33 -33
  24. data/lib/gateway/Parsers/credit_card_transaction_parser.rb +42 -42
  25. data/lib/gateway/Parsers/header_parser.rb +16 -16
  26. data/lib/gateway/Parsers/online_debit_transaction_parser.rb +32 -32
  27. data/lib/gateway/Parsers/trailer_parser.rb +16 -16
  28. data/lib/gateway/Person/buyer.rb +32 -32
  29. data/lib/gateway/Person/create_buyer_request.rb +22 -22
  30. data/lib/gateway/Person/person.rb +48 -48
  31. data/lib/gateway/Recurrency/recurrency.rb +24 -24
  32. data/lib/gateway/Sale/create_sale_request.rb +37 -37
  33. data/lib/gateway/Sale/manage_sale_request.rb +18 -18
  34. data/lib/gateway/Sale/query_sale_request.rb +37 -37
  35. data/lib/gateway/Sale/request_data.rb +21 -21
  36. data/lib/gateway/Sale/retry_sale_options.rb +15 -15
  37. data/lib/gateway/Sale/retry_sale_request.rb +23 -23
  38. data/lib/gateway/Sale/sale_data.rb +30 -30
  39. data/lib/gateway/Sale/sale_order_data.rb +18 -18
  40. data/lib/gateway/SalesOption.rb +18 -18
  41. data/lib/gateway/ShoppingCart/shopping_cart.rb +27 -27
  42. data/lib/gateway/ShoppingCart/shopping_cart_item.rb +24 -24
  43. data/lib/gateway/Trailer.rb +8 -8
  44. data/lib/gateway/header.rb +7 -7
  45. data/lib/gateway/post_notification.rb +31 -31
  46. data/lib/gateway/transaction_report_file.rb +47 -47
  47. data/lib/mundipagg_sdk.rb +61 -61
  48. data/mundipagg_sdk.gemspec +20 -20
  49. data/spec/integration/gateway_spec.rb +1023 -1022
  50. data/spec/integration/test_helper.rb +68 -68
  51. data/spec/spec_helper.rb +96 -96
  52. metadata +33 -33
@@ -1,34 +1,34 @@
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
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
34
  end
@@ -1,39 +1,39 @@
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
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
39
  end
@@ -1,34 +1,34 @@
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
+ 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,41 +1,41 @@
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
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
41
  end
@@ -1,17 +1,17 @@
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
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
17
  end
@@ -1,23 +1,23 @@
1
- module Gateway
2
-
3
- class BoletoTransactionReportFile
4
- attr_accessor :Order
5
- attr_accessor :TransactionKey
6
- attr_accessor :TransactionReference
7
- attr_accessor :Status
8
- attr_accessor :NossoNumero
9
- attr_accessor :BankNumber
10
- attr_accessor :Agency
11
- attr_accessor :Account
12
- attr_accessor :BarCode
13
- attr_accessor :ExpirationDate
14
- attr_accessor :AmountInCents
15
- attr_accessor :AmountPaidInCents
16
- attr_accessor :PaymentDate
17
- attr_accessor :CreditDate
18
-
19
- def initialize
20
- @Order = OrderTransactionReportFile.new
21
- end
22
- end
1
+ module Gateway
2
+
3
+ class BoletoTransactionReportFile
4
+ attr_accessor :Order
5
+ attr_accessor :TransactionKey
6
+ attr_accessor :TransactionReference
7
+ attr_accessor :Status
8
+ attr_accessor :NossoNumero
9
+ attr_accessor :BankNumber
10
+ attr_accessor :Agency
11
+ attr_accessor :Account
12
+ attr_accessor :BarCode
13
+ attr_accessor :ExpirationDate
14
+ attr_accessor :AmountInCents
15
+ attr_accessor :AmountPaidInCents
16
+ attr_accessor :PaymentDate
17
+ attr_accessor :CreditDate
18
+
19
+ def initialize
20
+ @Order = OrderTransactionReportFile.new
21
+ end
22
+ end
23
23
  end
@@ -1,31 +1,31 @@
1
- module Gateway
2
-
3
- class CreditCard
4
-
5
- attr_accessor :InstantBuyKey
6
-
7
- attr_accessor :CreditCardNumber
8
-
9
- attr_accessor :HolderName
10
-
11
- attr_accessor :SecurityCode
12
-
13
- attr_accessor :ExpMonth
14
-
15
- attr_accessor :ExpYear
16
-
17
- attr_accessor :CreditCardBrand
18
-
19
- attr_accessor :BillingAddress
20
-
21
- def initialize
22
- @BillingAddress = BillingAddress.new
23
- end
24
-
25
- def to_json
26
- hash = {}
27
- instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
28
- hash
29
- end
30
- end
1
+ module Gateway
2
+
3
+ class CreditCard
4
+
5
+ attr_accessor :InstantBuyKey
6
+
7
+ attr_accessor :CreditCardNumber
8
+
9
+ attr_accessor :HolderName
10
+
11
+ attr_accessor :SecurityCode
12
+
13
+ attr_accessor :ExpMonth
14
+
15
+ attr_accessor :ExpYear
16
+
17
+ attr_accessor :CreditCardBrand
18
+
19
+ attr_accessor :BillingAddress
20
+
21
+ def initialize
22
+ @BillingAddress = BillingAddress.new
23
+ end
24
+
25
+ def to_json
26
+ hash = {}
27
+ instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
28
+ hash
29
+ end
30
+ end
31
31
  end
@@ -1,34 +1,34 @@
1
- module Gateway
2
-
3
- class CreditCardTransaction
4
-
5
- attr_accessor :CreditCard
6
-
7
- attr_accessor :Options
8
-
9
- attr_accessor :Recurrency
10
-
11
- attr_accessor :AmountInCents
12
-
13
- attr_accessor :InstallmentCount
14
-
15
- attr_accessor :CreditCardOperation
16
-
17
- attr_accessor :TransactionReference
18
-
19
- attr_accessor :TransactionDateInMerchant
20
-
21
-
22
- def initialize
23
- @Options = CreditCardTransactionOptions.new
24
- @Recurrency = Recurrency.new
25
- @CreditCard = CreditCard.new
26
- end
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
1
+ module Gateway
2
+
3
+ class CreditCardTransaction
4
+
5
+ attr_accessor :CreditCard
6
+
7
+ attr_accessor :Options
8
+
9
+ attr_accessor :Recurrency
10
+
11
+ attr_accessor :AmountInCents
12
+
13
+ attr_accessor :InstallmentCount
14
+
15
+ attr_accessor :CreditCardOperation
16
+
17
+ attr_accessor :TransactionReference
18
+
19
+ attr_accessor :TransactionDateInMerchant
20
+
21
+
22
+ def initialize
23
+ @Options = CreditCardTransactionOptions.new
24
+ @Recurrency = Recurrency.new
25
+ @CreditCard = CreditCard.new
26
+ end
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
34
  end