mundipagg_sdk 1.0.3 → 1.2.3rc
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/README.md +61 -61
- data/lib/gateway/Address/billing_address.rb +34 -32
- data/lib/gateway/Address/buyer_address.rb +39 -36
- data/lib/gateway/Address/delivery_address.rb +34 -32
- data/lib/gateway/BoletoTransaction/boleto_transaction.rb +41 -43
- data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +17 -14
- data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +22 -19
- data/lib/gateway/CreditCardTransaction/credit_card.rb +30 -29
- data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +33 -31
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +28 -26
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +31 -28
- data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +14 -11
- data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +14 -12
- data/lib/gateway/Gateway.rb +621 -441
- 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 +12 -10
- data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +21 -18
- data/lib/gateway/Order/order.rb +13 -10
- data/lib/gateway/Order/order_transaction_report_file.rb +8 -5
- data/lib/gateway/Parsers/boleto_transaction_parser.rb +33 -30
- data/lib/gateway/Parsers/credit_card_transaction_parser.rb +42 -39
- data/lib/gateway/Parsers/header_parser.rb +16 -13
- data/lib/gateway/Parsers/online_debit_transaction_parser.rb +32 -29
- data/lib/gateway/Parsers/trailer_parser.rb +16 -14
- data/lib/gateway/Person/buyer.rb +32 -32
- data/lib/gateway/Person/create_buyer_request.rb +23 -0
- data/lib/gateway/Person/person.rb +48 -46
- data/lib/gateway/Recurrency/recurrency.rb +24 -22
- data/lib/gateway/Sale/create_sale_request.rb +37 -35
- data/lib/gateway/Sale/manage_sale_request.rb +18 -16
- data/lib/gateway/Sale/query_sale_request.rb +37 -35
- data/lib/gateway/Sale/request_data.rb +21 -19
- data/lib/gateway/Sale/retry_sale_options.rb +15 -13
- data/lib/gateway/Sale/retry_sale_request.rb +23 -22
- data/lib/gateway/Sale/sale_data.rb +30 -32
- data/lib/gateway/Sale/sale_order_data.rb +18 -16
- data/lib/gateway/SalesOption.rb +19 -17
- data/lib/gateway/ShoppingCart/shopping_cart.rb +27 -25
- data/lib/gateway/ShoppingCart/shopping_cart_item.rb +24 -22
- data/lib/gateway/Trailer.rb +8 -5
- data/lib/gateway/header.rb +7 -4
- data/lib/gateway/post_notification.rb +31 -28
- data/lib/gateway/transaction_report_file.rb +47 -44
- data/lib/mundipagg_sdk.rb +62 -70
- data/mundipagg_sdk.gemspec +19 -19
- data/spec/integration/gateway_spec.rb +1022 -733
- data/spec/integration/test_helper.rb +68 -68
- metadata +7 -21
- 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
@@ -1,69 +1,69 @@
|
|
1
|
-
require_relative '../../lib/mundipagg_sdk'
|
2
|
-
require 'gyoku'
|
3
|
-
class TestHelper
|
4
|
-
|
5
|
-
def self.JoinAndConvertAmountAndCents(amount, cents)
|
6
|
-
amount_with_cents = amount.gsub(',', '.')
|
7
|
-
return BigDecimal.new(amount_with_cents)
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.CreateFakePostNotification(create_order_result, manage_order_result)
|
11
|
-
xml = '<StatusNotification xmlns="http://schemas.datacontract.org/2004/07/Gateway.NotificationService.DataContract"
|
12
|
-
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
|
13
|
-
<AmountInCents>?</AmountInCents>
|
14
|
-
<AmountPaidInCents>?</AmountPaidInCents>
|
15
|
-
<BoletoTransaction i:nil="true"/>
|
16
|
-
<CreditCardTransaction>
|
17
|
-
<Acquirer>Cielo</Acquirer>
|
18
|
-
<AmountInCents>?</AmountInCents>
|
19
|
-
<AuthorizedAmountInCents>?</AuthorizedAmountInCents>
|
20
|
-
<CapturedAmountInCents>?</CapturedAmountInCents>
|
21
|
-
<CreditCardBrand>?</CreditCardBrand>
|
22
|
-
<RefundedAmountInCents i:nil="true"/>
|
23
|
-
<StatusChangedDate>?</StatusChangedDate>
|
24
|
-
<TransactionIdentifier>?</TransactionIdentifier>
|
25
|
-
<TransactionKey>?</TransactionKey>
|
26
|
-
<TransactionReference>?</TransactionReference>
|
27
|
-
<UniqueSequentialNumber>?</UniqueSequentialNumber>
|
28
|
-
<VoidedAmountInCents i:nil="true"/>
|
29
|
-
<PreviousCreditCardTransactionStatus>?</PreviousCreditCardTransactionStatus>
|
30
|
-
<CreditCardTransactionStatus>?</CreditCardTransactionStatus>
|
31
|
-
</CreditCardTransaction>
|
32
|
-
<MerchantKey>?</MerchantKey>
|
33
|
-
<OrderKey>?</OrderKey>
|
34
|
-
<OrderReference>?</OrderReference>
|
35
|
-
<OrderStatus>?</OrderStatus>
|
36
|
-
</StatusNotification>'
|
37
|
-
|
38
|
-
parser = Nori.new(:convert_tags_to => lambda { |tag| tag })
|
39
|
-
hash = parser.parse(xml)
|
40
|
-
|
41
|
-
credit_card_result = create_order_result['CreditCardTransactionResultCollection'][0]
|
42
|
-
manage_transaction_result = manage_order_result['CreditCardTransactionResultCollection'][0]
|
43
|
-
|
44
|
-
root = hash['StatusNotification']
|
45
|
-
|
46
|
-
root['AmountPaidInCents'] = 0
|
47
|
-
root['CreditCardTransaction'] = {
|
48
|
-
'Acquirer' => 'Cielo',
|
49
|
-
'AmountInCents' =>credit_card_result['AmountInCents'],
|
50
|
-
'AuthorizedAmountInCents'=> credit_card_result['AmountInCents'],
|
51
|
-
'CapturedAmountInCents' =>credit_card_result['AmountInCents'],
|
52
|
-
'CreditCardBrand' => 'Visa',
|
53
|
-
'RefundedAmountInCents' => nil,
|
54
|
-
'StatusChangedDate' => DateTime.now,
|
55
|
-
'TransactionIdentifier' => Array.new(12){[*'0'..'9', *'A'..'Z'].sample}.join,
|
56
|
-
'TransactionKey'=> credit_card_result['TransactionKey'],
|
57
|
-
'TransactionReference'=> credit_card_result['TransactionReference'],
|
58
|
-
'UniqueSequentialNumber' => Array.new(6){[*'0'..'9'].sample}.join,
|
59
|
-
'PreviousCreditCardTransactionStatus' => credit_card_result['CreditCardTransactionStatus'],
|
60
|
-
'CreditCardTransactionStatus' => (manage_transaction_result.nil? == true) ? 'null' : manage_transaction_result['CreditCardTransactionStatus']
|
61
|
-
}
|
62
|
-
root['MerchantKey'] = create_order_result['MerchantKey']
|
63
|
-
root['OrderKey'] = create_order_result['OrderResult']['OrderKey']
|
64
|
-
root['OrderReference'] = create_order_result['OrderResult']['OrderReference']
|
65
|
-
root['OrderStatus'] = (manage_transaction_result.nil? == true) ? 'null' : manage_transaction_result['CreditCardTransactionStatus']
|
66
|
-
|
67
|
-
return CGI::escapeHTML(Gyoku.xml(hash))
|
68
|
-
end
|
1
|
+
require_relative '../../lib/mundipagg_sdk'
|
2
|
+
require 'gyoku'
|
3
|
+
class TestHelper
|
4
|
+
|
5
|
+
def self.JoinAndConvertAmountAndCents(amount, cents)
|
6
|
+
amount_with_cents = amount.gsub(',', '.')
|
7
|
+
return BigDecimal.new(amount_with_cents)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.CreateFakePostNotification(create_order_result, manage_order_result)
|
11
|
+
xml = '<StatusNotification xmlns="http://schemas.datacontract.org/2004/07/Gateway.NotificationService.DataContract"
|
12
|
+
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
|
13
|
+
<AmountInCents>?</AmountInCents>
|
14
|
+
<AmountPaidInCents>?</AmountPaidInCents>
|
15
|
+
<BoletoTransaction i:nil="true"/>
|
16
|
+
<CreditCardTransaction>
|
17
|
+
<Acquirer>Cielo</Acquirer>
|
18
|
+
<AmountInCents>?</AmountInCents>
|
19
|
+
<AuthorizedAmountInCents>?</AuthorizedAmountInCents>
|
20
|
+
<CapturedAmountInCents>?</CapturedAmountInCents>
|
21
|
+
<CreditCardBrand>?</CreditCardBrand>
|
22
|
+
<RefundedAmountInCents i:nil="true"/>
|
23
|
+
<StatusChangedDate>?</StatusChangedDate>
|
24
|
+
<TransactionIdentifier>?</TransactionIdentifier>
|
25
|
+
<TransactionKey>?</TransactionKey>
|
26
|
+
<TransactionReference>?</TransactionReference>
|
27
|
+
<UniqueSequentialNumber>?</UniqueSequentialNumber>
|
28
|
+
<VoidedAmountInCents i:nil="true"/>
|
29
|
+
<PreviousCreditCardTransactionStatus>?</PreviousCreditCardTransactionStatus>
|
30
|
+
<CreditCardTransactionStatus>?</CreditCardTransactionStatus>
|
31
|
+
</CreditCardTransaction>
|
32
|
+
<MerchantKey>?</MerchantKey>
|
33
|
+
<OrderKey>?</OrderKey>
|
34
|
+
<OrderReference>?</OrderReference>
|
35
|
+
<OrderStatus>?</OrderStatus>
|
36
|
+
</StatusNotification>'
|
37
|
+
|
38
|
+
parser = Nori.new(:convert_tags_to => lambda { |tag| tag })
|
39
|
+
hash = parser.parse(xml)
|
40
|
+
|
41
|
+
credit_card_result = create_order_result['CreditCardTransactionResultCollection'][0]
|
42
|
+
manage_transaction_result = manage_order_result['CreditCardTransactionResultCollection'][0]
|
43
|
+
|
44
|
+
root = hash['StatusNotification']
|
45
|
+
|
46
|
+
root['AmountPaidInCents'] = 0
|
47
|
+
root['CreditCardTransaction'] = {
|
48
|
+
'Acquirer' => 'Cielo',
|
49
|
+
'AmountInCents' =>credit_card_result['AmountInCents'],
|
50
|
+
'AuthorizedAmountInCents'=> credit_card_result['AmountInCents'],
|
51
|
+
'CapturedAmountInCents' =>credit_card_result['AmountInCents'],
|
52
|
+
'CreditCardBrand' => 'Visa',
|
53
|
+
'RefundedAmountInCents' => nil,
|
54
|
+
'StatusChangedDate' => DateTime.now,
|
55
|
+
'TransactionIdentifier' => Array.new(12){[*'0'..'9', *'A'..'Z'].sample}.join,
|
56
|
+
'TransactionKey'=> credit_card_result['TransactionKey'],
|
57
|
+
'TransactionReference'=> credit_card_result['TransactionReference'],
|
58
|
+
'UniqueSequentialNumber' => Array.new(6){[*'0'..'9'].sample}.join,
|
59
|
+
'PreviousCreditCardTransactionStatus' => credit_card_result['CreditCardTransactionStatus'],
|
60
|
+
'CreditCardTransactionStatus' => (manage_transaction_result.nil? == true) ? 'null' : manage_transaction_result['CreditCardTransactionStatus']
|
61
|
+
}
|
62
|
+
root['MerchantKey'] = create_order_result['MerchantKey']
|
63
|
+
root['OrderKey'] = create_order_result['OrderResult']['OrderKey']
|
64
|
+
root['OrderReference'] = create_order_result['OrderResult']['OrderReference']
|
65
|
+
root['OrderStatus'] = (manage_transaction_result.nil? == true) ? 'null' : manage_transaction_result['CreditCardTransactionStatus']
|
66
|
+
|
67
|
+
return CGI::escapeHTML(Gyoku.xml(hash))
|
68
|
+
end
|
69
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mundipagg_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.3rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MundiPagg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -161,28 +161,18 @@ files:
|
|
161
161
|
- lib/gateway/Address/billing_address.rb
|
162
162
|
- lib/gateway/Address/buyer_address.rb
|
163
163
|
- lib/gateway/Address/delivery_address.rb
|
164
|
-
- lib/gateway/AntiFraud/anti_fraud_analysis_result.rb
|
165
|
-
- lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb
|
166
|
-
- lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb
|
167
|
-
- lib/gateway/BaseRequest.rb
|
168
|
-
- lib/gateway/BaseResponse.rb
|
169
164
|
- lib/gateway/BoletoTransaction/boleto_transaction.rb
|
170
|
-
- lib/gateway/BoletoTransaction/boleto_transaction_data.rb
|
171
165
|
- lib/gateway/BoletoTransaction/boleto_transaction_options.rb
|
172
166
|
- lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb
|
173
|
-
- lib/gateway/BoletoTransaction/boleto_transaction_result.rb
|
174
167
|
- lib/gateway/CreditCardTransaction/credit_card.rb
|
175
168
|
- lib/gateway/CreditCardTransaction/credit_card_transaction.rb
|
176
|
-
- lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb
|
177
169
|
- lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb
|
178
170
|
- lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb
|
179
171
|
- lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb
|
180
172
|
- lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb
|
181
|
-
- lib/gateway/ErrorItem.rb
|
182
|
-
- lib/gateway/ErrorReport.rb
|
183
173
|
- lib/gateway/Gateway.rb
|
184
|
-
- lib/gateway/
|
185
|
-
- lib/gateway/
|
174
|
+
- lib/gateway/InstantBuyData/create_instant_buy_data_request.rb
|
175
|
+
- lib/gateway/InstantBuyData/update_instant_buy_data_request.rb
|
186
176
|
- lib/gateway/Merchant/merchant.rb
|
187
177
|
- lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb
|
188
178
|
- lib/gateway/Order/order.rb
|
@@ -193,25 +183,21 @@ files:
|
|
193
183
|
- lib/gateway/Parsers/online_debit_transaction_parser.rb
|
194
184
|
- lib/gateway/Parsers/trailer_parser.rb
|
195
185
|
- lib/gateway/Person/buyer.rb
|
186
|
+
- lib/gateway/Person/create_buyer_request.rb
|
196
187
|
- lib/gateway/Person/person.rb
|
197
188
|
- lib/gateway/Recurrency/recurrency.rb
|
198
189
|
- lib/gateway/Sale/create_sale_request.rb
|
199
|
-
- lib/gateway/Sale/create_sale_response.rb
|
200
190
|
- lib/gateway/Sale/manage_sale_request.rb
|
201
|
-
- lib/gateway/Sale/manage_sale_response.rb
|
202
191
|
- lib/gateway/Sale/query_sale_request.rb
|
203
|
-
- lib/gateway/Sale/query_sale_response.rb
|
204
192
|
- lib/gateway/Sale/request_data.rb
|
205
193
|
- lib/gateway/Sale/retry_sale_options.rb
|
206
194
|
- lib/gateway/Sale/retry_sale_request.rb
|
207
|
-
- lib/gateway/Sale/retry_sale_response.rb
|
208
195
|
- lib/gateway/Sale/sale_data.rb
|
209
196
|
- lib/gateway/Sale/sale_order_data.rb
|
210
197
|
- lib/gateway/SalesOption.rb
|
211
198
|
- lib/gateway/ShoppingCart/shopping_cart.rb
|
212
199
|
- lib/gateway/ShoppingCart/shopping_cart_item.rb
|
213
200
|
- lib/gateway/Trailer.rb
|
214
|
-
- lib/gateway/address.rb
|
215
201
|
- lib/gateway/header.rb
|
216
202
|
- lib/gateway/post_notification.rb
|
217
203
|
- lib/gateway/transaction_report_file.rb
|
@@ -235,9 +221,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
221
|
version: 2.1.7
|
236
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
223
|
requirements:
|
238
|
-
- - "
|
224
|
+
- - ">"
|
239
225
|
- !ruby/object:Gem::Version
|
240
|
-
version:
|
226
|
+
version: 1.3.1
|
241
227
|
requirements: []
|
242
228
|
rubyforge_project:
|
243
229
|
rubygems_version: 2.4.8
|
@@ -1,47 +0,0 @@
|
|
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
|
@@ -1,51 +0,0 @@
|
|
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
|
@@ -1,41 +0,0 @@
|
|
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
|
data/lib/gateway/BaseRequest.rb
DELETED
@@ -1,11 +0,0 @@
|
|
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
|
data/lib/gateway/BaseResponse.rb
DELETED
@@ -1,17 +0,0 @@
|
|
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
|
@@ -1,44 +0,0 @@
|
|
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
|
@@ -1,35 +0,0 @@
|
|
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
|