stone_ecommerce 1.0.3 → 1.2.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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gateway/Address/billing_address.rb +25 -23
  3. data/lib/gateway/Address/buyer_address.rb +28 -25
  4. data/lib/gateway/Address/delivery_address.rb +24 -22
  5. data/lib/gateway/BoletoTransaction/boleto_transaction.rb +28 -30
  6. data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +14 -11
  7. data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +20 -17
  8. data/lib/gateway/CreditCardTransaction/credit_card.rb +19 -18
  9. data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +21 -19
  10. data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +17 -15
  11. data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +29 -26
  12. data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +11 -8
  13. data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +10 -8
  14. data/lib/gateway/Gateway.rb +514 -334
  15. data/lib/gateway/InstantBuyData/create_instant_buy_data_request.rb +31 -0
  16. data/lib/gateway/InstantBuyData/update_instant_buy_data_request.rb +11 -0
  17. data/lib/gateway/Merchant/merchant.rb +10 -8
  18. data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +19 -16
  19. data/lib/gateway/Order/order.rb +11 -8
  20. data/lib/gateway/Order/order_transaction_report_file.rb +8 -5
  21. data/lib/gateway/Parsers/boleto_transaction_parser.rb +28 -25
  22. data/lib/gateway/Parsers/credit_card_transaction_parser.rb +37 -34
  23. data/lib/gateway/Parsers/header_parser.rb +13 -10
  24. data/lib/gateway/Parsers/online_debit_transaction_parser.rb +26 -23
  25. data/lib/gateway/Parsers/trailer_parser.rb +13 -11
  26. data/lib/gateway/Person/buyer.rb +22 -22
  27. data/lib/gateway/Person/create_buyer_request.rb +23 -0
  28. data/lib/gateway/Person/person.rb +34 -32
  29. data/lib/gateway/Recurrency/recurrency.rb +18 -16
  30. data/lib/gateway/Sale/create_sale_request.rb +26 -24
  31. data/lib/gateway/Sale/manage_sale_request.rb +13 -11
  32. data/lib/gateway/Sale/query_sale_request.rb +27 -25
  33. data/lib/gateway/Sale/request_data.rb +16 -14
  34. data/lib/gateway/Sale/retry_sale_options.rb +12 -10
  35. data/lib/gateway/Sale/retry_sale_request.rb +15 -14
  36. data/lib/gateway/Sale/sale_data.rb +0 -2
  37. data/lib/gateway/Sale/sale_order_data.rb +14 -12
  38. data/lib/gateway/SalesOption.rb +13 -11
  39. data/lib/gateway/ShoppingCart/shopping_cart.rb +18 -16
  40. data/lib/gateway/ShoppingCart/shopping_cart_item.rb +15 -13
  41. data/lib/gateway/Trailer.rb +8 -5
  42. data/lib/gateway/header.rb +7 -4
  43. data/lib/gateway/post_notification.rb +23 -20
  44. data/lib/gateway/transaction_report_file.rb +43 -40
  45. data/lib/stone_ecommerce.rb +6 -14
  46. data/spec/integration/gateway_spec.rb +376 -85
  47. data/spec/spec_helper.rb +96 -96
  48. data/stone_ecommerce.gemspec +2 -2
  49. metadata +6 -20
  50. data/lib/gateway/AntiFraud/anti_fraud_analysis_result.rb +0 -47
  51. data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb +0 -51
  52. data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +0 -41
  53. data/lib/gateway/BaseRequest.rb +0 -11
  54. data/lib/gateway/BaseResponse.rb +0 -17
  55. data/lib/gateway/BoletoTransaction/boleto_transaction_data.rb +0 -44
  56. data/lib/gateway/BoletoTransaction/boleto_transaction_result.rb +0 -35
  57. data/lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb +0 -104
  58. data/lib/gateway/ErrorItem.rb +0 -17
  59. data/lib/gateway/ErrorReport.rb +0 -18
  60. data/lib/gateway/InstantBuy/credit_card_data.rb +0 -41
  61. data/lib/gateway/InstantBuy/get_instant_buy_data_response.rb +0 -18
  62. data/lib/gateway/Sale/create_sale_response.rb +0 -25
  63. data/lib/gateway/Sale/manage_sale_response.rb +0 -15
  64. data/lib/gateway/Sale/query_sale_response.rb +0 -18
  65. data/lib/gateway/Sale/retry_sale_response.rb +0 -14
  66. data/lib/gateway/address.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f4fc57ab11d12d82beeb343c68a8eddbd493287
4
- data.tar.gz: 2a24685f37a3c698c20e822a164a1d45a2c395c3
3
+ metadata.gz: 3352db6e95ec72f3b63294457c91ba2a1d855dc3
4
+ data.tar.gz: 6b9fee35281211af8159a7a5735dfe30b4ed218a
5
5
  SHA512:
6
- metadata.gz: deab0289ef8dec7c89f275d5174b61622f06916458bc867bb6d157dd41a1f709bfbf0760c14d2d73cb290b0faea1203536a92870ee44ee83eba63c18e4486ee2
7
- data.tar.gz: 40f877347602ac0213af2d43abcf5d0f9c7d6986c710ef2cd6002b0bbf7a089d1bb34926ad31e0e900dfa7338534099ae8573cbb3c0f2a884fffb3325a06b607
6
+ metadata.gz: 0af90fefdcf40c40c783fa85d8c1ba4558f587779127a86cc0c45fd9f2deb49708eaf2c2ae2816ea6bc168b3bfce673d4a80706f80b4fe2ed0d10e68a58c1875
7
+ data.tar.gz: 418dbd712a486f5a7ae50b6ae6a1b2d6efcf5833b64c16d20a38d30c772811e2e2b868d1ba384a53b935d547280bd83cd0d184807b30e6b31144e4f821bc398b
@@ -1,32 +1,34 @@
1
- class BillingAddress
2
- # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
3
- attr_accessor :Country
1
+ module Gateway
4
2
 
5
- # Estado
6
- attr_accessor :State
3
+ class BillingAddress
4
+ # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
5
+ attr_accessor :Country
7
6
 
8
- # Cidade
9
- attr_accessor :City
7
+ # Estado
8
+ attr_accessor :State
10
9
 
11
- # Distrito
12
- attr_accessor :District
10
+ # Cidade
11
+ attr_accessor :City
13
12
 
14
- # Logradouro
15
- attr_accessor :Street
13
+ # Distrito
14
+ attr_accessor :District
16
15
 
17
- # Número
18
- attr_accessor :Number
16
+ # Logradouro
17
+ attr_accessor :Street
19
18
 
20
- # Complemento
21
- attr_accessor :Complement
19
+ # Número
20
+ attr_accessor :Number
22
21
 
23
- # CEP
24
- attr_accessor :ZipCode
22
+ # Complemento
23
+ attr_accessor :Complement
25
24
 
26
- def to_json
27
- hash = {}
28
- instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
29
- hash
30
- end
25
+ # CEP
26
+ attr_accessor :ZipCode
31
27
 
32
- end
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,36 +1,39 @@
1
- class BuyerAddress
2
- # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
3
- attr_accessor :Country
1
+ module Gateway
4
2
 
5
- # Estado
6
- attr_accessor :State
3
+ class BuyerAddress
4
+ # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
5
+ attr_accessor :Country
7
6
 
8
- # Cidade
9
- attr_accessor :City
7
+ # Estado
8
+ attr_accessor :State
10
9
 
11
- # Distrito
12
- attr_accessor :District
10
+ # Cidade
11
+ attr_accessor :City
13
12
 
14
- # Logradouro
15
- attr_accessor :Street
13
+ # Distrito
14
+ attr_accessor :District
16
15
 
17
- # Número
18
- attr_accessor :Number
16
+ # Logradouro
17
+ attr_accessor :Street
19
18
 
20
- # Complemento
21
- attr_accessor :Complement
19
+ # Número
20
+ attr_accessor :Number
22
21
 
23
- # CEP
24
- attr_accessor :ZipCode
22
+ # Complemento
23
+ attr_accessor :Complement
25
24
 
26
- # Tipo de endereço
27
- attr_accessor :AddressType
25
+ # CEP
26
+ attr_accessor :ZipCode
28
27
 
28
+ # Tipo de endereço
29
+ attr_accessor :AddressType
29
30
 
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
31
 
36
- end
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
+ end
@@ -1,32 +1,34 @@
1
- class DeliveryAddress
2
- # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
3
- attr_accessor :Country
1
+ module Gateway
4
2
 
5
- # Estado
6
- attr_accessor :State
3
+ class DeliveryAddress
4
+ # País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
5
+ attr_accessor :Country
7
6
 
8
- # Cidade
9
- attr_accessor :City
7
+ # Estado
8
+ attr_accessor :State
10
9
 
11
- # Distrito
12
- attr_accessor :District
10
+ # Cidade
11
+ attr_accessor :City
13
12
 
14
- # Logradouro
15
- attr_accessor :Street
13
+ # Distrito
14
+ attr_accessor :District
16
15
 
17
- # Número
18
- attr_accessor :Number
16
+ # Logradouro
17
+ attr_accessor :Street
19
18
 
20
- # Complemento
21
- attr_accessor :Complement
19
+ # Número
20
+ attr_accessor :Number
22
21
 
23
- # zip code
24
- attr_accessor :ZipCode
22
+ # Complemento
23
+ attr_accessor :Complement
25
24
 
26
- def to_json
27
- hash = {}
28
- instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
29
- hash
30
- end
25
+ # zip code
26
+ attr_accessor :ZipCode
31
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
32
34
  end
@@ -1,43 +1,41 @@
1
1
  require 'json'
2
+ module Gateway
2
3
 
3
- class BoletoTransaction
4
+ class BoletoTransaction
4
5
 
5
- # Valor do boleto em centavos
6
- attr_accessor :AmountInCents
6
+ # Valor do boleto em centavos
7
+ attr_accessor :AmountInCents
7
8
 
8
- # Número do banco
9
- attr_accessor :BankNumber
9
+ # Número do banco
10
+ attr_accessor :BankNumber
10
11
 
11
- # Instruções a serem impressas no boleto
12
- attr_accessor :Instructions
12
+ # Instruções a serem impressas no boleto
13
+ attr_accessor :Instructions
13
14
 
14
- # Número do documento
15
- attr_accessor :DocumentNumber
15
+ # Número do documento
16
+ attr_accessor :DocumentNumber
16
17
 
17
- # Indentificador da transação no sistema da loja
18
- attr_accessor :TransactionReference
18
+ # Indentificador da transação no sistema da loja
19
+ attr_accessor :TransactionReference
19
20
 
20
- # Data da criação da transação no sistema da loja
21
- attr_accessor :TransactionDateInMerchant
21
+ # Data da criação da transação no sistema da loja
22
+ attr_accessor :TransactionDateInMerchant
22
23
 
23
- # Opções da transação de boleto
24
- attr_accessor :Options
24
+ # Opções da transação de boleto
25
+ attr_accessor :Options
25
26
 
26
- # Endereço de cobrança
27
- attr_accessor :BillingAddress
28
-
29
- def initialize
30
- @Options = BoletoTransactionOptions.new
31
- @BillingAddress = BillingAddress.new
32
- end
27
+ # Endereço de cobrança
28
+ attr_accessor :BillingAddress
33
29
 
30
+ def initialize
31
+ @Options = BoletoTransactionOptions.new
32
+ @BillingAddress = BillingAddress.new
33
+ end
34
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)
35
+ def to_json
36
+ hash = {}
37
+ instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
38
+ hash
39
+ end
41
40
  end
42
-
43
- end
41
+ end
@@ -1,14 +1,17 @@
1
- class BoletoTransactionOptions
2
- # Total de dias para expirar o boleto
3
- attr_accessor :DaysToAddInBoletoExpirationDate
1
+ module Gateway
4
2
 
5
- # Moeda. Opções: BRL, EUR, USD, ARS, BOB, CLP, COP, UYU, MXN, PYG
6
- attr_accessor :CurrencyIso
3
+ class BoletoTransactionOptions
4
+ # Total de dias para expirar o boleto
5
+ attr_accessor :DaysToAddInBoletoExpirationDate
7
6
 
8
- def to_json
9
- hash = {}
10
- instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
11
- hash
12
- end
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
13
15
 
14
- end
16
+ end
17
+ end
@@ -1,20 +1,23 @@
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
1
+ module Gateway
16
2
 
17
- def initialize
18
- @Order = OrderTransactionReportFile.new
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
19
22
  end
20
23
  end
@@ -1,30 +1,31 @@
1
- class CreditCard
1
+ module Gateway
2
2
 
3
- attr_accessor :InstantBuyKey
3
+ class CreditCard
4
4
 
5
- attr_accessor :CreditCardNumber
5
+ attr_accessor :InstantBuyKey
6
6
 
7
- attr_accessor :HolderName
7
+ attr_accessor :CreditCardNumber
8
8
 
9
- attr_accessor :SecurityCode
9
+ attr_accessor :HolderName
10
10
 
11
- attr_accessor :ExpMonth
11
+ attr_accessor :SecurityCode
12
12
 
13
- attr_accessor :ExpYear
13
+ attr_accessor :ExpMonth
14
14
 
15
- attr_accessor :CreditCardBrand
15
+ attr_accessor :ExpYear
16
16
 
17
- attr_accessor :BillingAddress
17
+ attr_accessor :CreditCardBrand
18
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
19
+ attr_accessor :BillingAddress
28
20
 
21
+ def initialize
22
+ @BillingAddress = BillingAddress.new
23
+ end
29
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
30
31
  end
@@ -1,32 +1,34 @@
1
- class CreditCardTransaction
1
+ module Gateway
2
2
 
3
- attr_accessor :CreditCard
3
+ class CreditCardTransaction
4
4
 
5
- attr_accessor :Options
5
+ attr_accessor :CreditCard
6
6
 
7
- attr_accessor :Recurrency
7
+ attr_accessor :Options
8
8
 
9
- attr_accessor :AmountInCents
9
+ attr_accessor :Recurrency
10
10
 
11
- attr_accessor :InstallmentCount
11
+ attr_accessor :AmountInCents
12
12
 
13
- attr_accessor :CreditCardOperation
13
+ attr_accessor :InstallmentCount
14
14
 
15
- attr_accessor :TransactionReference
15
+ attr_accessor :CreditCardOperation
16
16
 
17
- attr_accessor :TransactionDateInMerchant
17
+ attr_accessor :TransactionReference
18
18
 
19
+ attr_accessor :TransactionDateInMerchant
19
20
 
20
- def initialize
21
- @Options = CreditCardTransactionOptions.new
22
- @Recurrency = Recurrency.new
23
- @CreditCard = CreditCard.new
24
- end
25
21
 
26
- def to_json
27
- hash = {}
28
- instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
29
- hash
30
- end
22
+ def initialize
23
+ @Options = CreditCardTransactionOptions.new
24
+ @Recurrency = Recurrency.new
25
+ @CreditCard = CreditCard.new
26
+ end
31
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
32
34
  end
@@ -1,27 +1,29 @@
1
- class CreditCardTransactionOptions
1
+ module Gateway
2
2
 
3
- attr_accessor :PaymentMethodCode
3
+ class CreditCardTransactionOptions
4
4
 
5
- attr_accessor :CurrencyIso
5
+ attr_accessor :PaymentMethodCode
6
6
 
7
- attr_accessor :IataAmountInCents
7
+ attr_accessor :CurrencyIso
8
8
 
9
- attr_accessor :CaptureDelayInMinutes
9
+ attr_accessor :IataAmountInCents
10
10
 
11
- attr_accessor :MerchantCategoryCode
11
+ attr_accessor :CaptureDelayInMinutes
12
12
 
13
- attr_accessor :SoftDescriptorText
13
+ attr_accessor :MerchantCategoryCode
14
14
 
15
- attr_accessor :InterestRate
15
+ attr_accessor :SoftDescriptorText
16
16
 
17
- attr_accessor :ExtendedLimitEnabled
17
+ attr_accessor :InterestRate
18
18
 
19
- attr_accessor :ExtendedLimitCode
19
+ attr_accessor :ExtendedLimitEnabled
20
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
21
+ attr_accessor :ExtendedLimitCode
26
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
+ end
27
29
  end