rails-gp-webpay 0.2.6 → 0.2.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 557be3e38c554946e0fe2839549b752342205f2bfaa911a4861a3f1ea268c1a3
4
- data.tar.gz: e48dd123da0ac8e2180d43917e3b3c2e63e8afe56cb17b08127824f65faf4f24
3
+ metadata.gz: 0d20729c87099bedef965f67c65e97ff49896c05cf5f828a827d9ec26425e131
4
+ data.tar.gz: 56cbb512e5586786739f47a98c55da5aac529b50585dd1d82e875968e32489ee
5
5
  SHA512:
6
- metadata.gz: ae3c2c5e04ae5cb2230e28a87d732f8769679b48f2ee0f1eb0f0c2b00e553a69cdaecad3201e0cf6368a0e359ca8f99b970939204160c4b98d1d6869af79ed7e
7
- data.tar.gz: ce49aa4b92af16bfb9aff3cec47c2baf190c5361045bbf7acb134a61a2f93626c005725bc80cf854bb592ce3e109b35900234c6841bb365f7b2dc46faf8256fc
6
+ metadata.gz: 71ed518c96d9b121109f7e8d8411680643ff8c8656bd42812b7dbad961b4b5bec725de2c32b704336e775c8f5e014c81184f2a05e66b4a6ca6137ec8bbb65178
7
+ data.tar.gz: 8905c888bbe6cfc5462b188e00b34acb3ffb94fe3d141261b1da7e6a3d5d54b014957b4aad735019c69c784c0f2021f86d3f3668ec9d9f6d4018b3229d0e123d
data/changelog.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.7
4
+ Pr and Sr codes in stubs
5
+
3
6
  ## 0.2.6
4
7
  Add merchant number to tests, add default attributes to requests
5
8
 
@@ -24,13 +24,18 @@ module GpWebpay
24
24
  def stub_card_token(token, status: 'VERIFIED', success: true, valid: true)
25
25
  allow(GpWebpay::Ws::Services::GetTokenStatus)
26
26
  .to receive(:call).with(hash_including(token_data: token, message_id: anything))
27
- .and_return(instance_double(GpWebpay::Ws::WsResponse, valid?: valid, success?: success, status: status))
27
+ .and_return(instance_double(GpWebpay::Ws::WsResponse, valid?: valid, success?: success, status: status,
28
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
29
+ original_response: { pr_code: 0, sr_code: 0 }))
28
30
  end
29
31
 
30
32
  def stub_master_payment_status(payment_number, status: 'OK', success: true, valid: true)
31
33
  allow(GpWebpay::Ws::Services::GetMasterPaymentStatus)
32
34
  .to receive(:call).with(hash_including(payment_number: payment_number, message_id: anything))
33
- .and_return(instance_double(GpWebpay::Ws::WsResponse, valid?: valid, success?: success, status: status))
35
+ .and_return(instance_double(GpWebpay::Ws::WsResponse, valid?: valid, success?: success, status: status,
36
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
37
+ original_response: { pr_code: 0, sr_code: 0 }))
38
+
34
39
  end
35
40
 
36
41
  def stub_payment_status(payment_number, merchant_number: nil, status: 'VERIFIED', sub_status: 'SETTLED', success: true, valid: true)
@@ -38,6 +43,8 @@ module GpWebpay
38
43
  .to receive(:call).with(hash_including(payment_number: payment_number, message_id: anything), merchant_number: merchant_number)
39
44
  .and_return(instance_double(GpWebpay::Ws::WsResponse,
40
45
  valid?: valid, success?: success, status: status,
46
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
47
+ original_response: { pr_code: 0, sr_code: 0 },
41
48
  params: { sub_status: sub_status }))
42
49
  end
43
50
 
@@ -55,6 +62,7 @@ module GpWebpay
55
62
  ).and_return(instance_double(GpWebpay::Ws::WsResponse,
56
63
  valid?: valid, success?: success, status: status, result_text: result_text,
57
64
  pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
65
+ original_response: { pr_code: 0, sr_code: 0 },
58
66
  params: { token_data: response_token_data || attributes[:token_data] }))
59
67
  end
60
68
 
@@ -64,7 +72,8 @@ module GpWebpay
64
72
  hash_including({ message_id: anything }.merge(token_data: token))
65
73
  ).and_return(instance_double(GpWebpay::Ws::WsResponse,
66
74
  valid?: valid, success?: success, status: status, result_text: result_text,
67
- pr_code: success ? '0' : '123', sr_code: success ? '0' : '4'))
75
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
76
+ original_response: { pr_code: 0, sr_code: 0 }))
68
77
  end
69
78
 
70
79
  def stub_refund_payment(attributes, merchant_number: nil, valid: true, success: true, status: '', result_text: 'OK')
@@ -73,7 +82,8 @@ module GpWebpay
73
82
  hash_including({ message_id: anything }.merge(attributes)), merchant_number: merchant_number
74
83
  ).and_return(instance_double(GpWebpay::Ws::WsResponse,
75
84
  valid?: valid, success?: success, status: status, result_text: result_text,
76
- pr_code: success ? '0' : '123', sr_code: success ? '0' : '4'))
85
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
86
+ original_response: { pr_code: 0, sr_code: 0 }))
77
87
  end
78
88
 
79
89
  def stub_capture_reverse(attributes, merchant_number: nil, valid: true, success: true, status: '', result_text: 'OK')
@@ -82,7 +92,8 @@ module GpWebpay
82
92
  hash_including({ message_id: anything }.merge(attributes)), merchant_number: merchant_number
83
93
  ).and_return(instance_double(GpWebpay::Ws::WsResponse,
84
94
  valid?: valid, success?: success, status: status, result_text: result_text,
85
- pr_code: success ? '0' : '123', sr_code: success ? '0' : '4'))
95
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
96
+ original_response: { pr_code: 0, sr_code: 0 }))
86
97
  end
87
98
 
88
99
  def stub_cancel_capture(attributes, merchant_number: nil, valid: true, success: true, status: '', result_text: 'OK')
@@ -91,7 +102,8 @@ module GpWebpay
91
102
  hash_including({ message_id: anything }.merge(attributes)), merchant_number: merchant_number
92
103
  ).and_return(instance_double(GpWebpay::Ws::WsResponse,
93
104
  valid?: valid, success?: success, status: status, result_text: result_text,
94
- pr_code: success ? '0' : '123', sr_code: success ? '0' : '4'))
105
+ pr_code: success ? '0' : '123', sr_code: success ? '0' : '4',
106
+ original_response: { pr_code: 0, sr_code: 0 }))
95
107
  end
96
108
  end
97
109
 
@@ -1,3 +1,3 @@
1
1
  module GpWebpay
2
- VERSION = '0.2.6'.freeze
2
+ VERSION = '0.2.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-gp-webpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lubomir Vnenk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-23 00:00:00.000000000 Z
11
+ date: 2021-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport