blockchyp 2.2.4 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4569f1fe2455fe98d3e09d7ed59c9d91f81bc366bcfc7b64dfbbaf1026443670
4
- data.tar.gz: 6ce270e6356101d6afee6b72462e6c6580dc59e1203e74b288ef0d5db2cb5e2c
3
+ metadata.gz: a9b0bc43922617adfcb4e8f0d20eef4d54a5dac3aee17efd246aaa6789caeac7
4
+ data.tar.gz: c21e621def8bc145fe223771f205912ea20a0596ade43bf04f1a9c462ba476c7
5
5
  SHA512:
6
- metadata.gz: 24fd0fc590987fa3e552ac0ad9ad6574a01c06c9db34007f9db5432deb7db0ca5b83fbf7c5ebc99b46261eae269a15e379de4bd2e43c061a3465b1d98680ec40
7
- data.tar.gz: f1df347d1baf97a3275971d0141464dbb980310cfd18ad03196813515fcb2ebc2074b3c9e336804c559b097de111ae01935e850725c9dd6f45da66e8654aa5a1
6
+ metadata.gz: b7e80346fa5aef7adacb2d2328cf4639bd937c235a750ab835dfa16a576c26223df9c5ca7fdfec9b1b6f49ab36b13898240cc07660aff3e7b7184e7181e11670
7
+ data.tar.gz: 5855fa07b214ba2eee7327c93af6eaefd73b2781e1a584658637ba63c89eb12a8af583a6226490fff027a5ea62eee900ba9de41c604f1c413c752b607dbcc699
data/README.md CHANGED
@@ -852,6 +852,34 @@ response = blockchyp.customerSearch(request)
852
852
  puts "Response: #{response.inspect}"
853
853
 
854
854
 
855
+ ```
856
+
857
+ #### Cash Discount
858
+
859
+ Calculates the discount for actual cash transactions.
860
+
861
+
862
+ ```ruby
863
+ # frozen_string_literal: true
864
+
865
+ require 'blockchyp'
866
+
867
+ blockchyp = BlockChyp::BlockChyp.new(
868
+ ENV['BC_API_KEY'],
869
+ ENV['BC_BEARER_TOKEN'],
870
+ ENV['BC_SIGNING_KEY']
871
+ )
872
+
873
+ # Set request parameters
874
+ request = {
875
+ "amount": '100.00'
876
+ }
877
+
878
+ response = blockchyp.cashDiscount(request)
879
+
880
+ puts "Response: #{response.inspect}"
881
+
882
+
855
883
  ```
856
884
 
857
885
  #### Transaction Status
@@ -176,6 +176,11 @@ module BlockChyp
176
176
  gateway_request('POST', '/api/customer-search', request)
177
177
  end
178
178
 
179
+ # Calculates the discount for actual cash transactions.
180
+ def cash_discount(request)
181
+ gateway_request('POST', '/api/cash-discount', request)
182
+ end
183
+
179
184
  # Retrieves the current status of a transaction.
180
185
  def transaction_status(request)
181
186
  gateway_request('POST', '/api/tx-status', request)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlockChyp
4
- VERSION = '2.2.4'
4
+ VERSION = '2.3.1'
5
5
  end
@@ -24,7 +24,7 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'get_customer_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "customer": {
29
29
  "firstName": 'Test',
30
30
  "lastName": 'Customer',
@@ -34,7 +34,7 @@ module BlockChyp
34
34
  }
35
35
  }
36
36
 
37
- response = blockchyp.customer(request)
37
+ response = blockchyp.update_customer(setup_request)
38
38
 
39
39
  # Set request parameters
40
40
  request = {
@@ -42,7 +42,7 @@ module BlockChyp
42
42
  assert(!response['transactionId'].empty?)
43
43
  assert(!response['timestamp'].empty?)
44
44
  assert(!response['tickBlock'].empty?)
45
- assert_equal('Approved', response['responseDescription'])
45
+ assert_equal('approved', response['responseDescription'])
46
46
  assert(!response['paymentType'].empty?)
47
47
  assert(!response['maskedPan'].empty?)
48
48
  assert(!response['entryMethod'].empty?)
@@ -40,7 +40,7 @@ module BlockChyp
40
40
  assert(!response['transactionId'].empty?)
41
41
  assert(!response['timestamp'].empty?)
42
42
  assert(!response['tickBlock'].empty?)
43
- assert_equal('Approved', response['responseDescription'])
43
+ assert_equal('approved', response['responseDescription'])
44
44
  assert(!response['paymentType'].empty?)
45
45
  assert(!response['maskedPan'].empty?)
46
46
  assert(!response['entryMethod'].empty?)
@@ -41,7 +41,7 @@ module BlockChyp
41
41
  assert(!response['transactionId'].empty?)
42
42
  assert(!response['timestamp'].empty?)
43
43
  assert(!response['tickBlock'].empty?)
44
- assert_equal('Approved', response['responseDescription'])
44
+ assert_equal('approved', response['responseDescription'])
45
45
  assert(!response['paymentType'].empty?)
46
46
  assert(!response['maskedPan'].empty?)
47
47
  assert(!response['entryMethod'].empty?)
@@ -24,7 +24,7 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'search_customer_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "customer": {
29
29
  "firstName": 'Test',
30
30
  "lastName": 'Customer',
@@ -34,7 +34,7 @@ module BlockChyp
34
34
  }
35
35
  }
36
36
 
37
- response = blockchyp.customer_search(request)
37
+ response = blockchyp.update_customer(setup_request)
38
38
 
39
39
  # Set request parameters
40
40
  request = {
@@ -24,14 +24,14 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'simple_batch_close_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "pan": '4111111111111111',
29
29
  "amount": '25.55',
30
30
  "test": true,
31
31
  "transactionRef": uuid
32
32
  }
33
33
 
34
- response = blockchyp.close_batch(request)
34
+ response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
@@ -24,13 +24,13 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'simple_capture_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "pan": '4111111111111111',
29
29
  "amount": '25.55',
30
30
  "test": true
31
31
  }
32
32
 
33
- response = blockchyp.capture(request)
33
+ response = blockchyp.preauth(setup_request)
34
34
 
35
35
  # Set request parameters
36
36
  request = {
@@ -24,14 +24,14 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'simple_refund_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "pan": '4111111111111111',
29
29
  "amount": '25.55',
30
30
  "test": true,
31
31
  "transactionRef": uuid
32
32
  }
33
33
 
34
- response = blockchyp.refund(request)
34
+ response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
@@ -24,14 +24,14 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'simple_reversal_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "pan": '4111111111111111',
29
29
  "amount": '25.55',
30
30
  "test": true,
31
31
  "transactionRef": uuid
32
32
  }
33
33
 
34
- response = blockchyp.reverse(request)
34
+ response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
@@ -24,14 +24,14 @@ module BlockChyp
24
24
  test_delay(blockchyp, 'simple_void_test')
25
25
 
26
26
  # Set request parameters
27
- request = {
27
+ setup_request = {
28
28
  "pan": '4111111111111111',
29
29
  "amount": '25.55',
30
30
  "test": true,
31
31
  "transactionRef": uuid
32
32
  }
33
33
 
34
- response = blockchyp.void(request)
34
+ response = blockchyp.charge(setup_request)
35
35
 
36
36
  # Set request parameters
37
37
  request = {
@@ -41,7 +41,7 @@ module BlockChyp
41
41
  assert(!response['transactionId'].empty?)
42
42
  assert(!response['timestamp'].empty?)
43
43
  assert(!response['tickBlock'].empty?)
44
- assert_equal('Approved', response['responseDescription'])
44
+ assert_equal('approved', response['responseDescription'])
45
45
  assert(!response['paymentType'].empty?)
46
46
  assert(!response['maskedPan'].empty?)
47
47
  assert(!response['entryMethod'].empty?)
@@ -42,7 +42,7 @@ module BlockChyp
42
42
  assert(!response['transactionId'].empty?)
43
43
  assert(!response['timestamp'].empty?)
44
44
  assert(!response['tickBlock'].empty?)
45
- assert_equal('Approved', response['responseDescription'])
45
+ assert_equal('approved', response['responseDescription'])
46
46
  assert(!response['paymentType'].empty?)
47
47
  assert(!response['maskedPan'].empty?)
48
48
  assert(!response['entryMethod'].empty?)
@@ -40,7 +40,7 @@ module BlockChyp
40
40
  assert(!response['transactionId'].empty?)
41
41
  assert(!response['timestamp'].empty?)
42
42
  assert(!response['tickBlock'].empty?)
43
- assert_equal('Approved', response['responseDescription'])
43
+ assert_equal('approved', response['responseDescription'])
44
44
  assert(!response['paymentType'].empty?)
45
45
  assert(!response['maskedPan'].empty?)
46
46
  assert(!response['entryMethod'].empty?)
@@ -42,7 +42,7 @@ module BlockChyp
42
42
  assert(!response['transactionId'].empty?)
43
43
  assert(!response['timestamp'].empty?)
44
44
  assert(!response['tickBlock'].empty?)
45
- assert_equal('Approved', response['responseDescription'])
45
+ assert_equal('approved', response['responseDescription'])
46
46
  assert(!response['paymentType'].empty?)
47
47
  assert(!response['maskedPan'].empty?)
48
48
  assert(!response['entryMethod'].empty?)
@@ -43,7 +43,7 @@ module BlockChyp
43
43
  assert(!response['transactionId'].empty?)
44
44
  assert(!response['timestamp'].empty?)
45
45
  assert(!response['tickBlock'].empty?)
46
- assert_equal('Approved', response['responseDescription'])
46
+ assert_equal('approved', response['responseDescription'])
47
47
  assert(!response['paymentType'].empty?)
48
48
  assert(!response['maskedPan'].empty?)
49
49
  assert(!response['entryMethod'].empty?)
@@ -41,7 +41,7 @@ module BlockChyp
41
41
  assert(!response['transactionId'].empty?)
42
42
  assert(!response['timestamp'].empty?)
43
43
  assert(!response['tickBlock'].empty?)
44
- assert_equal('Approved', response['responseDescription'])
44
+ assert_equal('approved', response['responseDescription'])
45
45
  assert(!response['paymentType'].empty?)
46
46
  assert(!response['maskedPan'].empty?)
47
47
  assert(!response['entryMethod'].empty?)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockchyp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlockChyp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-04-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: