mundipagg_sdk 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -61
- data/lib/gateway/Address/billing_address.rb +32 -32
- data/lib/gateway/Address/buyer_address.rb +36 -36
- data/lib/gateway/Address/delivery_address.rb +32 -32
- data/lib/gateway/AntiFraud/anti_fraud_analysis_result.rb +47 -47
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_data.rb +51 -51
- data/lib/gateway/AntiFraud/query_sale_anti_fraud_analysis_history_data.rb +41 -41
- data/lib/gateway/BaseRequest.rb +10 -10
- data/lib/gateway/BaseResponse.rb +17 -17
- data/lib/gateway/BoletoTransaction/boleto_transaction.rb +43 -43
- data/lib/gateway/BoletoTransaction/boleto_transaction_data.rb +43 -43
- data/lib/gateway/BoletoTransaction/boleto_transaction_options.rb +14 -14
- data/lib/gateway/BoletoTransaction/boleto_transaction_report_file.rb +19 -19
- data/lib/gateway/BoletoTransaction/boleto_transaction_result.rb +34 -34
- data/lib/gateway/CreditCardTransaction/credit_card.rb +29 -29
- data/lib/gateway/CreditCardTransaction/credit_card_transaction.rb +31 -31
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_data.rb +103 -103
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_options.rb +26 -26
- data/lib/gateway/CreditCardTransaction/credit_card_transaction_report_file.rb +28 -28
- data/lib/gateway/CreditCardTransaction/manage_credit_card_transaction.rb +11 -11
- data/lib/gateway/CreditCardTransaction/retry_sale_credit_card_transaction.rb +12 -12
- data/lib/gateway/ErrorItem.rb +17 -17
- data/lib/gateway/ErrorReport.rb +18 -18
- data/lib/gateway/Gateway.rb +441 -444
- data/lib/gateway/InstantBuy/credit_card_data.rb +40 -40
- data/lib/gateway/InstantBuy/get_instant_buy_data_response.rb +17 -17
- data/lib/gateway/Merchant/merchant.rb +10 -10
- data/lib/gateway/OnlineDebit/online_debit_transaction_report_file.rb +17 -17
- data/lib/gateway/Order/order.rb +10 -10
- data/lib/gateway/Order/order_transaction_report_file.rb +5 -5
- data/lib/gateway/Parsers/boleto_transaction_parser.rb +30 -30
- data/lib/gateway/Parsers/credit_card_transaction_parser.rb +39 -39
- data/lib/gateway/Parsers/header_parser.rb +13 -13
- data/lib/gateway/Parsers/online_debit_transaction_parser.rb +29 -29
- data/lib/gateway/Parsers/trailer_parser.rb +14 -14
- data/lib/gateway/Person/buyer.rb +32 -32
- data/lib/gateway/Person/person.rb +46 -46
- data/lib/gateway/Recurrency/recurrency.rb +22 -22
- data/lib/gateway/Sale/create_sale_request.rb +35 -35
- data/lib/gateway/Sale/create_sale_response.rb +24 -24
- data/lib/gateway/Sale/manage_sale_request.rb +16 -16
- data/lib/gateway/Sale/manage_sale_response.rb +14 -14
- data/lib/gateway/Sale/query_sale_request.rb +35 -35
- data/lib/gateway/Sale/query_sale_response.rb +17 -17
- data/lib/gateway/Sale/request_data.rb +19 -19
- data/lib/gateway/Sale/retry_sale_options.rb +13 -13
- data/lib/gateway/Sale/retry_sale_request.rb +21 -21
- data/lib/gateway/Sale/retry_sale_response.rb +13 -13
- data/lib/gateway/Sale/sale_data.rb +32 -32
- data/lib/gateway/Sale/sale_order_data.rb +16 -16
- data/lib/gateway/SalesOption.rb +17 -17
- data/lib/gateway/ShoppingCart/shopping_cart.rb +25 -25
- data/lib/gateway/ShoppingCart/shopping_cart_item.rb +22 -22
- data/lib/gateway/Trailer.rb +5 -5
- data/lib/gateway/address.rb +24 -24
- data/lib/gateway/header.rb +4 -4
- data/lib/gateway/post_notification.rb +28 -28
- data/lib/gateway/transaction_report_file.rb +44 -44
- data/lib/mundipagg_sdk.rb +70 -70
- data/mundipagg_sdk.gemspec +18 -18
- data/spec/integration/gateway_spec.rb +733 -651
- data/spec/integration/test_helper.rb +68 -68
- metadata +2 -2
@@ -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.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MundiPagg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|