blockchyp 2.24.4 → 2.24.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 +4 -4
- data/README.md +37 -0
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp.rb +5 -0
- data/test/update_token_test.rb +57 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d77f104f9c865d4f3a7b72eb7f3c735801eef59f64c2f55c010f50543a36ff10
|
4
|
+
data.tar.gz: e49a24b02503a23d00aee3d6f655d0ad9f908fb7a2c4d86cf2c85b54a6819557
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b139fe14ebde8237f18d071aafa15b59c2cb0d5930476c17d6b2152526c704bb2c3160efe88079c40f607f8f73683fb1521b71952f15246ddd5444c5d778b85f
|
7
|
+
data.tar.gz: 5c36fce128d55f1c5e7a5ecdf0ebfdc5d9e683aed95a0bebbafab85f72ca011de40b5f0f44c936da2f48b36f52b8c6527d43030279e2a9fcf08d1a1100b5263f
|
data/README.md
CHANGED
@@ -2540,6 +2540,43 @@ response = blockchyp.unlinkToken(request)
|
|
2540
2540
|
puts "Response: #{response.inspect}"
|
2541
2541
|
|
2542
2542
|
|
2543
|
+
```
|
2544
|
+
|
2545
|
+
#### Update Token
|
2546
|
+
|
2547
|
+
|
2548
|
+
|
2549
|
+
* **API Credential Types:** Merchant
|
2550
|
+
* **Required Role:** Payment API Access
|
2551
|
+
|
2552
|
+
This API updates a payment token in the gateway. This can be used to update token metadata such as expiration dates, cardholder name, bank name, account holder type, account type, address, and postal code.
|
2553
|
+
|
2554
|
+
|
2555
|
+
|
2556
|
+
|
2557
|
+
```ruby
|
2558
|
+
# frozen_string_literal: true
|
2559
|
+
|
2560
|
+
require 'blockchyp'
|
2561
|
+
|
2562
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
2563
|
+
ENV['BC_API_KEY'],
|
2564
|
+
ENV['BC_BEARER_TOKEN'],
|
2565
|
+
ENV['BC_SIGNING_KEY']
|
2566
|
+
)
|
2567
|
+
|
2568
|
+
# Set request parameters
|
2569
|
+
request = {
|
2570
|
+
token: '<TOKEN>',
|
2571
|
+
expMonth: 12,
|
2572
|
+
expYear: 2040
|
2573
|
+
}
|
2574
|
+
|
2575
|
+
response = blockchyp.updateToken(request)
|
2576
|
+
|
2577
|
+
puts "Response: #{response.inspect}"
|
2578
|
+
|
2579
|
+
|
2543
2580
|
```
|
2544
2581
|
|
2545
2582
|
#### Delete Token
|
data/lib/blockchyp/version.rb
CHANGED
data/lib/blockchyp.rb
CHANGED
@@ -325,6 +325,11 @@ module BlockChyp
|
|
325
325
|
gateway_request('POST', '/api/unlink-token', request)
|
326
326
|
end
|
327
327
|
|
328
|
+
# Updates a payment token.
|
329
|
+
def update_token(request)
|
330
|
+
gateway_request('POST', '/api/token/' + request[:token], request)
|
331
|
+
end
|
332
|
+
|
328
333
|
# Deletes a payment token.
|
329
334
|
def delete_token(request)
|
330
335
|
gateway_request('DELETE', '/api/token/' + request[:token], request)
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2019-2025 BlockChyp, Inc. All rights reserved. Use of this code is
|
4
|
+
# governed by a license that can be found in the LICENSE file.
|
5
|
+
#
|
6
|
+
# This file was generated automatically by the BlockChyp SDK Generator.
|
7
|
+
# Changes to this file will be lost every time the code is regenerated.
|
8
|
+
|
9
|
+
require ::File.expand_path('test_helper', __dir__)
|
10
|
+
|
11
|
+
module BlockChyp
|
12
|
+
class UpdateTokenTest < TestCase
|
13
|
+
def test_update_token
|
14
|
+
|
15
|
+
puts "Running test_update_token..."
|
16
|
+
|
17
|
+
config = load_test_config
|
18
|
+
|
19
|
+
blockchyp = BlockChyp.new(
|
20
|
+
config[:apiKey],
|
21
|
+
config[:bearerToken],
|
22
|
+
config[:signingKey]
|
23
|
+
)
|
24
|
+
blockchyp.gateway_host = config[:gatewayHost]
|
25
|
+
blockchyp.test_gateway_host = config[:testGatewayHost]
|
26
|
+
blockchyp.dashboard_host = config[:dashboardHost]
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
# Set request parameters
|
33
|
+
setup_request = {
|
34
|
+
pan: '4111111111111111',
|
35
|
+
test: true,
|
36
|
+
customer: {
|
37
|
+
customerRef: 'TESTCUSTOMER',
|
38
|
+
firstName: 'Test',
|
39
|
+
lastName: 'Customer'
|
40
|
+
}
|
41
|
+
}
|
42
|
+
response = blockchyp.enroll(setup_request)
|
43
|
+
|
44
|
+
# Set request parameters
|
45
|
+
request = {
|
46
|
+
token: response[:token],
|
47
|
+
expMonth: 12,
|
48
|
+
expYear: 2040
|
49
|
+
}
|
50
|
+
|
51
|
+
response = blockchyp.update_token(request)
|
52
|
+
assert_not_nil(response)
|
53
|
+
# response assertions
|
54
|
+
assert(response[:success])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
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.24.
|
4
|
+
version: 2.24.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BlockChyp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- test/update_merchant_test.rb
|
120
120
|
- test/update_slide_show_test.rb
|
121
121
|
- test/update_survey_question_test.rb
|
122
|
+
- test/update_token_test.rb
|
122
123
|
- test/update_transaction_display_test.rb
|
123
124
|
- test/upload_status_test.rb
|
124
125
|
homepage: https://github.com/blockchyp/blockchyp-ruby
|