blockchyp 2.15.24 → 2.15.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +75 -1
- data/lib/blockchyp/version.rb +1 -1
- data/lib/blockchyp.rb +10 -0
- data/test/payment_link_status_test.rb +72 -0
- data/test/resend_payment_link_test.rb +49 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3deacf875401f15866ccb30d023d0fea003f9ae2a409097ff2467e4b83626858
|
4
|
+
data.tar.gz: cda2f4369908eeaba76d25c98b1bdb8e8ccc7b1f843c5af984cae13c840f728b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91d9ab49675b04289c980d7da4eb5c1dbfe5f6454a8f212c74f4caca781134307453a17699c4a45fac2d8ca946838094d7477f5744c87983e8750673ded26189
|
7
|
+
data.tar.gz: 2b5f2b95df428d1bf31a105d99961a262a7d27c5288126212bea1e7bb2de80fab5cef175ad70fdedaf965580d4775dec9a54ad781b5a3a3f98dc0bf7094e1c1f
|
data/README.md
CHANGED
@@ -705,6 +705,8 @@ display additional UI widgets that allowing customers to switch to a crypto paym
|
|
705
705
|
Add the `enroll` flag to a send link request to enroll the payment method
|
706
706
|
in the token vault.
|
707
707
|
|
708
|
+
Add the `enrollOnly` flag to enroll the payment method in the token vault without any immediate payment taking place. The payment link will ask the user for their payment information and inform them that they will not be charged immediately, but that their payment may be used for future transactions.
|
709
|
+
|
708
710
|
**Cashier Facing Card Entry**
|
709
711
|
|
710
712
|
BlockChyp can be used to generate internal/cashier facing card entry pages as well. This is
|
@@ -790,6 +792,42 @@ response = blockchyp.sendPaymentLink(request)
|
|
790
792
|
puts "Response: #{response.inspect}"
|
791
793
|
|
792
794
|
|
795
|
+
```
|
796
|
+
|
797
|
+
#### Resend Payment Link
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
* **API Credential Types:** Merchant
|
802
|
+
* **Required Role:** Payment API Access
|
803
|
+
|
804
|
+
This API will resend a previously created payment link. An error is returned if the payment link is expired, has been
|
805
|
+
cancelled, or has already been paid.
|
806
|
+
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
```ruby
|
811
|
+
# frozen_string_literal: true
|
812
|
+
|
813
|
+
require 'blockchyp'
|
814
|
+
|
815
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
816
|
+
ENV['BC_API_KEY'],
|
817
|
+
ENV['BC_BEARER_TOKEN'],
|
818
|
+
ENV['BC_SIGNING_KEY']
|
819
|
+
)
|
820
|
+
|
821
|
+
# Set request parameters
|
822
|
+
request = {
|
823
|
+
linkCode: '<PAYMENT LINK CODE>'
|
824
|
+
}
|
825
|
+
|
826
|
+
response = blockchyp.resendPaymentLink(request)
|
827
|
+
|
828
|
+
puts "Response: #{response.inspect}"
|
829
|
+
|
830
|
+
|
793
831
|
```
|
794
832
|
|
795
833
|
#### Cancel Payment Link
|
@@ -825,6 +863,42 @@ response = blockchyp.cancelPaymentLink(request)
|
|
825
863
|
puts "Response: #{response.inspect}"
|
826
864
|
|
827
865
|
|
866
|
+
```
|
867
|
+
|
868
|
+
#### Payment Link Status
|
869
|
+
|
870
|
+
|
871
|
+
|
872
|
+
* **API Credential Types:** Merchant
|
873
|
+
* **Required Role:** Payment API Access
|
874
|
+
|
875
|
+
This API allows you to check on the status of a payment link, including transaction data
|
876
|
+
and the full history of attempted transactions.
|
877
|
+
|
878
|
+
|
879
|
+
|
880
|
+
|
881
|
+
```ruby
|
882
|
+
# frozen_string_literal: true
|
883
|
+
|
884
|
+
require 'blockchyp'
|
885
|
+
|
886
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
887
|
+
ENV['BC_API_KEY'],
|
888
|
+
ENV['BC_BEARER_TOKEN'],
|
889
|
+
ENV['BC_SIGNING_KEY']
|
890
|
+
)
|
891
|
+
|
892
|
+
# Set request parameters
|
893
|
+
request = {
|
894
|
+
linkCode: response[:linkCode]
|
895
|
+
}
|
896
|
+
|
897
|
+
response = blockchyp.paymentLinkStatus(request)
|
898
|
+
|
899
|
+
puts "Response: #{response.inspect}"
|
900
|
+
|
901
|
+
|
828
902
|
```
|
829
903
|
|
830
904
|
#### Transaction Status
|
@@ -1617,7 +1691,7 @@ puts "Response: #{response.inspect}"
|
|
1617
1691
|
* **API Credential Types:** Merchant
|
1618
1692
|
* **Required Role:** Payment API Access
|
1619
1693
|
|
1620
|
-
This API
|
1694
|
+
This API prompts the customer to answer a yes or no question.
|
1621
1695
|
|
1622
1696
|
You can specify the question or prompt with the `prompt` parameter and
|
1623
1697
|
the response is returned in the `response` field.
|
data/lib/blockchyp/version.rb
CHANGED
data/lib/blockchyp.rb
CHANGED
@@ -209,11 +209,21 @@ module BlockChyp
|
|
209
209
|
gateway_request('POST', '/api/send-payment-link', request)
|
210
210
|
end
|
211
211
|
|
212
|
+
# Resends payment link.
|
213
|
+
def resend_payment_link(request)
|
214
|
+
gateway_request('POST', '/api/resend-payment-link', request)
|
215
|
+
end
|
216
|
+
|
212
217
|
# Cancels a payment link.
|
213
218
|
def cancel_payment_link(request)
|
214
219
|
gateway_request('POST', '/api/cancel-payment-link', request)
|
215
220
|
end
|
216
221
|
|
222
|
+
# Retrieves the status of a payment link.
|
223
|
+
def payment_link_status(request)
|
224
|
+
gateway_request('POST', '/api/payment-link-status', request)
|
225
|
+
end
|
226
|
+
|
217
227
|
# Retrieves the current status of a transaction.
|
218
228
|
def transaction_status(request)
|
219
229
|
gateway_request('POST', '/api/tx-status', request)
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2019-2023 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 PaymentLinkStatusTest < TestCase
|
13
|
+
def test_payment_link_status
|
14
|
+
|
15
|
+
puts "Running test_payment_link_status..."
|
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
|
+
amount: '199.99',
|
35
|
+
description: 'Widget',
|
36
|
+
subject: 'Widget invoice',
|
37
|
+
transaction: {
|
38
|
+
subtotal: '195.00',
|
39
|
+
tax: '4.99',
|
40
|
+
total: '199.99',
|
41
|
+
items: [
|
42
|
+
{
|
43
|
+
description: 'Widget',
|
44
|
+
price: '195.00',
|
45
|
+
quantity: 1
|
46
|
+
}
|
47
|
+
]
|
48
|
+
},
|
49
|
+
autoSend: true,
|
50
|
+
customer: {
|
51
|
+
customerRef: 'Customer reference string',
|
52
|
+
firstName: 'FirstName',
|
53
|
+
lastName: 'LastName',
|
54
|
+
companyName: 'Company Name',
|
55
|
+
emailAddress: 'notifications@blockchypteam.m8r.co',
|
56
|
+
smsNumber: '(123) 123-1231'
|
57
|
+
}
|
58
|
+
}
|
59
|
+
response = blockchyp.send_payment_link(setup_request)
|
60
|
+
|
61
|
+
# Set request parameters
|
62
|
+
request = {
|
63
|
+
transactionRef: response[:transactionRef]
|
64
|
+
}
|
65
|
+
|
66
|
+
response = blockchyp.payment_link_status(request)
|
67
|
+
assert_not_nil(response)
|
68
|
+
# response assertions
|
69
|
+
assert(response[:success])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2019-2023 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 ResendPaymentLinkTest < TestCase
|
13
|
+
def test_resend_payment_link
|
14
|
+
|
15
|
+
puts "Running test_resend_payment_link..."
|
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
|
+
linkCode: response[:linkCode]
|
35
|
+
}
|
36
|
+
response = blockchyp.resend_payment_link(setup_request)
|
37
|
+
|
38
|
+
# Set request parameters
|
39
|
+
request = {
|
40
|
+
linkCode: response[:linkCode]
|
41
|
+
}
|
42
|
+
|
43
|
+
response = blockchyp.resend_payment_link(request)
|
44
|
+
assert_not_nil(response)
|
45
|
+
# response assertions
|
46
|
+
assert(response[:success])
|
47
|
+
end
|
48
|
+
end
|
49
|
+
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.15.
|
4
|
+
version: 2.15.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BlockChyp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -59,6 +59,8 @@ files:
|
|
59
59
|
- test/pan_enroll_test.rb
|
60
60
|
- test/pan_preauth_test.rb
|
61
61
|
- test/partial_refund_test.rb
|
62
|
+
- test/payment_link_status_test.rb
|
63
|
+
- test/resend_payment_link_test.rb
|
62
64
|
- test/search_customer_test.rb
|
63
65
|
- test/send_payment_link_test.rb
|
64
66
|
- test/simple_batch_close_test.rb
|