mundipagg 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mundipagg/gateway.rb +6 -3
- data/lib/mundipagg/version.rb +1 -1
- data/tests/features/credit_card.feature +6 -0
- data/tests/features/step_definitions/boleto_steps.rb +1 -2
- data/tests/features/step_definitions/credit_card_steps.rb +17 -1
- data/tests/features/step_definitions/post_notification.rb +2 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fab418a639f550403738600b1c324386a3dac0b
|
4
|
+
data.tar.gz: 9707f232cf16a4bbf41087c32cea15e34480877e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97e07bb9ef9e37cc4314c21413d064a169598682e06883866411c83475bac6c312a66abb2355f17e140bc62ff0b0a01051dc4a9ccfbcf2b9315660b01d522933
|
7
|
+
data.tar.gz: 930a0b84b398b2415627291e923d2bb998278099e76606b842048d40903d74c82d061b2c4431db335c30d2b5936da2356efbda5997244eaeb3e971886032c5c7
|
data/lib/mundipagg/gateway.rb
CHANGED
@@ -316,12 +316,14 @@ module Mundipagg
|
|
316
316
|
end
|
317
317
|
|
318
318
|
level = :debug
|
319
|
-
enable_log = true
|
320
|
-
|
319
|
+
enable_log = true
|
320
|
+
filters = [:CreditCardNumber,
|
321
|
+
:SecurityCode,
|
322
|
+
:MerchantKey]
|
321
323
|
|
322
324
|
if @log_level == :none
|
323
|
-
enable_log = false
|
324
325
|
level = :error
|
326
|
+
enable_log = false
|
325
327
|
end
|
326
328
|
|
327
329
|
|
@@ -329,6 +331,7 @@ module Mundipagg
|
|
329
331
|
wsdl url
|
330
332
|
log enable_log
|
331
333
|
log_level level
|
334
|
+
filters filters
|
332
335
|
namespaces 'xmlns:mun' => 'http://schemas.datacontract.org/2004/07/MundiPagg.One.Service.DataContracts'
|
333
336
|
end
|
334
337
|
|
data/lib/mundipagg/version.rb
CHANGED
@@ -14,3 +14,9 @@ Feature: Credit Card Transaction
|
|
14
14
|
And I will send to Mundipagg
|
15
15
|
Then the order amount in cents should be 10029
|
16
16
|
And the transaction status should be Captured
|
17
|
+
|
18
|
+
Scenario: Keeping sensible information unlogged
|
19
|
+
Given I have purchase three products with a total cost of BRL 100,29
|
20
|
+
And I will pay using a Visa credit card without installment
|
21
|
+
And I will send to Mundipagg
|
22
|
+
Then the log file doesn't contain sensible information
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Before do
|
4
4
|
@client = Mundipagg::Gateway.new :test
|
5
|
-
@client.log_level = :
|
5
|
+
@client.log_level = :debug
|
6
6
|
@order = Mundipagg::CreateOrderRequest.new
|
7
7
|
@boleto = Mundipagg::BoletoTransaction.new
|
8
8
|
@response = Hash.new
|
@@ -39,7 +39,6 @@ Given(/^I send to Mundipagg$/) do
|
|
39
39
|
@response = @client.CreateOrder(@order)
|
40
40
|
end
|
41
41
|
|
42
|
-
|
43
42
|
Then(/^The order amount in cents should be (\d+)$/) do |amountInCents|
|
44
43
|
transaction = @response[:create_order_response][:create_order_result][:boleto_transaction_result_collection][:boleto_transaction_result]
|
45
44
|
transaction[:amount_in_cents].to_s.should == amountInCents
|
@@ -34,7 +34,15 @@ Given(/^I will pay using a (\w+) credit card in (\d+) installments$/) do |brand,
|
|
34
34
|
end
|
35
35
|
|
36
36
|
Given(/^I will send to Mundipagg$/) do
|
37
|
-
|
37
|
+
old_stdout = $stdout
|
38
|
+
@stdout = StringIO.new
|
39
|
+
$stdout = @stdout
|
40
|
+
@client.log_level = :debug
|
41
|
+
begin
|
42
|
+
@response = @client.CreateOrder(@order)
|
43
|
+
ensure
|
44
|
+
$stdout = old_stdout
|
45
|
+
end
|
38
46
|
end
|
39
47
|
|
40
48
|
Then(/^the order amount in cents should be (\d+)$/) do |amountInCents|
|
@@ -72,3 +80,11 @@ Given(/^I will pay using a (\w+) credit card without installment$/) do |brand|
|
|
72
80
|
@transaction.creditCardOperationEnum = Mundipagg::CreditCardTransaction.OperationEnum[:AuthAndCapture]
|
73
81
|
|
74
82
|
end
|
83
|
+
|
84
|
+
#Scenario 3:
|
85
|
+
|
86
|
+
Then(/^the log file doesn't contain sensible information$/) do
|
87
|
+
@stdout.string.should_not include(@transaction.creditCardNumber)
|
88
|
+
@stdout.string.should_not include(@transaction.securityCode)
|
89
|
+
@stdout.string.should_not include(@order.merchantKey)
|
90
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
Before do
|
3
3
|
|
4
|
-
@client = Mundipagg::Gateway.new :
|
4
|
+
@client = Mundipagg::Gateway.new :production
|
5
5
|
@client.log_level = :none
|
6
6
|
|
7
7
|
@order = Mundipagg::CreateOrderRequest.new
|
@@ -24,6 +24,7 @@ Given(/^I have pre authorized a credit card transaction of (\w+) (\d+)\.(\d+)$/)
|
|
24
24
|
@order.amountInCents = (amount_decimal * 100).to_i
|
25
25
|
@order.amountInCentsToConsiderPaid = (amount_decimal * 100).to_i
|
26
26
|
|
27
|
+
|
27
28
|
@transaction.amountInCents = @order.amountInCents;
|
28
29
|
@transaction.creditCardBrandEnum = Mundipagg::CreditCardTransaction.BrandEnum[:Visa]
|
29
30
|
@transaction.creditCardOperationEnum = Mundipagg::CreditCardTransaction.OperationEnum[:AuthOnly] #Pre-authorization
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mundipagg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
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: 2014-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -79,4 +79,3 @@ signing_key:
|
|
79
79
|
specification_version: 4
|
80
80
|
summary: MundiPagg Ruby Client Library
|
81
81
|
test_files: []
|
82
|
-
has_rdoc:
|