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.
- checksums.yaml +4 -4
- data/lib/gateway/Address/billing_address.rb +25 -23
- data/lib/gateway/Address/buyer_address.rb +28 -25
- data/lib/gateway/Address/delivery_address.rb +24 -22
- data/lib/gateway/BoletoTransaction/boleto_transaction.rb +28 -30
- data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +14 -11
- data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +20 -17
- data/lib/gateway/CreditCardTransaction/credit_card.rb +19 -18
- data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +21 -19
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +17 -15
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +29 -26
- data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +11 -8
- data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +10 -8
- data/lib/gateway/Gateway.rb +514 -334
- data/lib/gateway/InstantBuyData/create_instant_buy_data_request.rb +31 -0
- data/lib/gateway/InstantBuyData/update_instant_buy_data_request.rb +11 -0
- data/lib/gateway/Merchant/merchant.rb +10 -8
- data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +19 -16
- data/lib/gateway/Order/order.rb +11 -8
- data/lib/gateway/Order/order_transaction_report_file.rb +8 -5
- data/lib/gateway/Parsers/boleto_transaction_parser.rb +28 -25
- data/lib/gateway/Parsers/credit_card_transaction_parser.rb +37 -34
- data/lib/gateway/Parsers/header_parser.rb +13 -10
- data/lib/gateway/Parsers/online_debit_transaction_parser.rb +26 -23
- data/lib/gateway/Parsers/trailer_parser.rb +13 -11
- data/lib/gateway/Person/buyer.rb +22 -22
- data/lib/gateway/Person/create_buyer_request.rb +23 -0
- data/lib/gateway/Person/person.rb +34 -32
- data/lib/gateway/Recurrency/recurrency.rb +18 -16
- data/lib/gateway/Sale/create_sale_request.rb +26 -24
- data/lib/gateway/Sale/manage_sale_request.rb +13 -11
- data/lib/gateway/Sale/query_sale_request.rb +27 -25
- data/lib/gateway/Sale/request_data.rb +16 -14
- data/lib/gateway/Sale/retry_sale_options.rb +12 -10
- data/lib/gateway/Sale/retry_sale_request.rb +15 -14
- data/lib/gateway/Sale/sale_data.rb +0 -2
- data/lib/gateway/Sale/sale_order_data.rb +14 -12
- data/lib/gateway/SalesOption.rb +13 -11
- data/lib/gateway/ShoppingCart/shopping_cart.rb +18 -16
- data/lib/gateway/ShoppingCart/shopping_cart_item.rb +15 -13
- data/lib/gateway/Trailer.rb +8 -5
- data/lib/gateway/header.rb +7 -4
- data/lib/gateway/post_notification.rb +23 -20
- data/lib/gateway/transaction_report_file.rb +43 -40
- data/lib/stone_ecommerce.rb +6 -14
- data/spec/integration/gateway_spec.rb +376 -85
- data/spec/spec_helper.rb +96 -96
- data/stone_ecommerce.gemspec +2 -2
- metadata +6 -20
- data/lib/gateway/AntiFraud/anti_fraud_analysis_result.rb +0 -47
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb +0 -51
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +0 -41
- data/lib/gateway/BaseRequest.rb +0 -11
- data/lib/gateway/BaseResponse.rb +0 -17
- data/lib/gateway/BoletoTransaction/boleto_transaction_data.rb +0 -44
- data/lib/gateway/BoletoTransaction/boleto_transaction_result.rb +0 -35
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb +0 -104
- data/lib/gateway/ErrorItem.rb +0 -17
- data/lib/gateway/ErrorReport.rb +0 -18
- data/lib/gateway/InstantBuy/credit_card_data.rb +0 -41
- data/lib/gateway/InstantBuy/get_instant_buy_data_response.rb +0 -18
- data/lib/gateway/Sale/create_sale_response.rb +0 -25
- data/lib/gateway/Sale/manage_sale_response.rb +0 -15
- data/lib/gateway/Sale/query_sale_response.rb +0 -18
- data/lib/gateway/Sale/retry_sale_response.rb +0 -14
- data/lib/gateway/address.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3352db6e95ec72f3b63294457c91ba2a1d855dc3
|
4
|
+
data.tar.gz: 6b9fee35281211af8159a7a5735dfe30b4ed218a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0af90fefdcf40c40c783fa85d8c1ba4558f587779127a86cc0c45fd9f2deb49708eaf2c2ae2816ea6bc168b3bfce673d4a80706f80b4fe2ed0d10e68a58c1875
|
7
|
+
data.tar.gz: 418dbd712a486f5a7ae50b6ae6a1b2d6efcf5833b64c16d20a38d30c772811e2e2b868d1ba384a53b935d547280bd83cd0d184807b30e6b31144e4f821bc398b
|
@@ -1,32 +1,34 @@
|
|
1
|
-
|
2
|
-
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
3
|
-
attr_accessor :Country
|
1
|
+
module Gateway
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
class BillingAddress
|
4
|
+
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
5
|
+
attr_accessor :Country
|
7
6
|
|
8
|
-
|
9
|
-
|
7
|
+
# Estado
|
8
|
+
attr_accessor :State
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
# Cidade
|
11
|
+
attr_accessor :City
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
# Distrito
|
14
|
+
attr_accessor :District
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
# Logradouro
|
17
|
+
attr_accessor :Street
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
# Número
|
20
|
+
attr_accessor :Number
|
22
21
|
|
23
|
-
|
24
|
-
|
22
|
+
# Complemento
|
23
|
+
attr_accessor :Complement
|
25
24
|
|
26
|
-
|
27
|
-
|
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
|
-
|
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
|
-
|
2
|
-
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
3
|
-
attr_accessor :Country
|
1
|
+
module Gateway
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
class BuyerAddress
|
4
|
+
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
5
|
+
attr_accessor :Country
|
7
6
|
|
8
|
-
|
9
|
-
|
7
|
+
# Estado
|
8
|
+
attr_accessor :State
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
# Cidade
|
11
|
+
attr_accessor :City
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
# Distrito
|
14
|
+
attr_accessor :District
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
# Logradouro
|
17
|
+
attr_accessor :Street
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
# Número
|
20
|
+
attr_accessor :Number
|
22
21
|
|
23
|
-
|
24
|
-
|
22
|
+
# Complemento
|
23
|
+
attr_accessor :Complement
|
25
24
|
|
26
|
-
|
27
|
-
|
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
|
-
|
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
|
-
|
2
|
-
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
3
|
-
attr_accessor :Country
|
1
|
+
module Gateway
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
class DeliveryAddress
|
4
|
+
# País. Opções: Brazil, USA, Argentina, Bolivia, Chile, Colombia, Uruguay, Mexico, Paraguay
|
5
|
+
attr_accessor :Country
|
7
6
|
|
8
|
-
|
9
|
-
|
7
|
+
# Estado
|
8
|
+
attr_accessor :State
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
# Cidade
|
11
|
+
attr_accessor :City
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
# Distrito
|
14
|
+
attr_accessor :District
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
# Logradouro
|
17
|
+
attr_accessor :Street
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
# Número
|
20
|
+
attr_accessor :Number
|
22
21
|
|
23
|
-
|
24
|
-
|
22
|
+
# Complemento
|
23
|
+
attr_accessor :Complement
|
25
24
|
|
26
|
-
|
27
|
-
|
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
|
-
|
6
|
-
|
6
|
+
# Valor do boleto em centavos
|
7
|
+
attr_accessor :AmountInCents
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
# Número do banco
|
10
|
+
attr_accessor :BankNumber
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
# Instruções a serem impressas no boleto
|
13
|
+
attr_accessor :Instructions
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
# Número do documento
|
16
|
+
attr_accessor :DocumentNumber
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
# Indentificador da transação no sistema da loja
|
19
|
+
attr_accessor :TransactionReference
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
# Data da criação da transação no sistema da loja
|
22
|
+
attr_accessor :TransactionDateInMerchant
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
# Opções da transação de boleto
|
25
|
+
attr_accessor :Options
|
25
26
|
|
26
|
-
|
27
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
2
|
-
# Total de dias para expirar o boleto
|
3
|
-
attr_accessor :DaysToAddInBoletoExpirationDate
|
1
|
+
module Gateway
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
class BoletoTransactionOptions
|
4
|
+
# Total de dias para expirar o boleto
|
5
|
+
attr_accessor :DaysToAddInBoletoExpirationDate
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
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
|
-
|
18
|
-
|
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
|
-
|
1
|
+
module Gateway
|
2
2
|
|
3
|
-
|
3
|
+
class CreditCard
|
4
4
|
|
5
|
-
|
5
|
+
attr_accessor :InstantBuyKey
|
6
6
|
|
7
|
-
|
7
|
+
attr_accessor :CreditCardNumber
|
8
8
|
|
9
|
-
|
9
|
+
attr_accessor :HolderName
|
10
10
|
|
11
|
-
|
11
|
+
attr_accessor :SecurityCode
|
12
12
|
|
13
|
-
|
13
|
+
attr_accessor :ExpMonth
|
14
14
|
|
15
|
-
|
15
|
+
attr_accessor :ExpYear
|
16
16
|
|
17
|
-
|
17
|
+
attr_accessor :CreditCardBrand
|
18
18
|
|
19
|
-
|
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
|
-
|
1
|
+
module Gateway
|
2
2
|
|
3
|
-
|
3
|
+
class CreditCardTransaction
|
4
4
|
|
5
|
-
|
5
|
+
attr_accessor :CreditCard
|
6
6
|
|
7
|
-
|
7
|
+
attr_accessor :Options
|
8
8
|
|
9
|
-
|
9
|
+
attr_accessor :Recurrency
|
10
10
|
|
11
|
-
|
11
|
+
attr_accessor :AmountInCents
|
12
12
|
|
13
|
-
|
13
|
+
attr_accessor :InstallmentCount
|
14
14
|
|
15
|
-
|
15
|
+
attr_accessor :CreditCardOperation
|
16
16
|
|
17
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
1
|
+
module Gateway
|
2
2
|
|
3
|
-
|
3
|
+
class CreditCardTransactionOptions
|
4
4
|
|
5
|
-
|
5
|
+
attr_accessor :PaymentMethodCode
|
6
6
|
|
7
|
-
|
7
|
+
attr_accessor :CurrencyIso
|
8
8
|
|
9
|
-
|
9
|
+
attr_accessor :IataAmountInCents
|
10
10
|
|
11
|
-
|
11
|
+
attr_accessor :CaptureDelayInMinutes
|
12
12
|
|
13
|
-
|
13
|
+
attr_accessor :MerchantCategoryCode
|
14
14
|
|
15
|
-
|
15
|
+
attr_accessor :SoftDescriptorText
|
16
16
|
|
17
|
-
|
17
|
+
attr_accessor :InterestRate
|
18
18
|
|
19
|
-
|
19
|
+
attr_accessor :ExtendedLimitEnabled
|
20
20
|
|
21
|
-
|
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
|