blockchyp 2.2.2 → 2.2.3
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 +236 -244
- data/lib/blockchyp/version.rb +1 -1
- data/test/boolean_prompt_test.rb +8 -8
- data/test/capture_signature_test.rb +6 -6
- data/test/gateway_timeout_test.rb +8 -8
- data/test/get_customer_test.rb +51 -0
- data/test/new_transaction_display_test.rb +24 -44
- data/test/pan_charge_test.rb +7 -7
- data/test/pan_enroll_test.rb +5 -5
- data/test/pan_preauth_test.rb +6 -6
- data/test/search_customer_test.rb +51 -0
- data/test/send_payment_link_test.rb +62 -0
- data/test/simple_batch_close_test.rb +13 -11
- data/test/simple_capture_test.rb +13 -11
- data/test/simple_gift_activate_test.rb +6 -6
- data/test/simple_message_test.rb +6 -6
- data/test/simple_ping_test.rb +5 -5
- data/test/simple_refund_test.rb +14 -12
- data/test/simple_reversal_test.rb +14 -12
- data/test/simple_void_test.rb +14 -12
- data/test/terminal_charge_test.rb +6 -6
- data/test/terminal_clear_test.rb +5 -5
- data/test/terminal_ebt_balance_test.rb +6 -6
- data/test/terminal_ebt_charge_test.rb +7 -7
- data/test/terminal_enroll_test.rb +5 -5
- data/test/terminal_gift_card_balance_test.rb +5 -5
- data/test/terminal_keyed_charge_test.rb +7 -7
- data/test/terminal_manual_ebt_charge_test.rb +8 -8
- data/test/terminal_preauth_test.rb +6 -6
- data/test/terminal_status_test.rb +4 -4
- data/test/terminal_timeout_test.rb +7 -7
- data/test/terms_and_conditions_test.rb +10 -10
- data/test/text_prompt_test.rb +6 -6
- data/test/update_customer_test.rb +44 -0
- data/test/update_transaction_display_test.rb +24 -44
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 640fb1f472a292a08ea6b5009271a2bda797e2f84c3e92bbdd0bdb5014f0d6ad
|
4
|
+
data.tar.gz: 4cc390ff6b200c0ca74cc23fdb218f0c768ca9cecb5d0eb117270589f27b1673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2491272d0419b4e8f111449d8133703448a96d5f79767ea678e4c7b36cfcb00d2bf93bfbf28be8bc9467a2fb17b3ff5b5fd844c1e924f5c22f9b84f5998c4f
|
7
|
+
data.tar.gz: 3bf5736d5c9f0727f94974a07b03f7bfef88c4d586e6867ec1ad9629c06cef57e8ec9fbabd24f803919255f7c7f2aa4b028c4a5641592d3c378051183e89e755
|
data/README.md
CHANGED
@@ -25,13 +25,18 @@ to run a basic terminal transaction.
|
|
25
25
|
```ruby
|
26
26
|
require 'blockchyp'
|
27
27
|
|
28
|
-
blockchyp = BlockChyp.new(
|
28
|
+
blockchyp = BlockChyp.new(
|
29
|
+
"SPBXTSDAQVFFX5MGQMUMIRINVI",
|
30
|
+
"7BXBTBUPSL3BP7I6Z2CFU6H3WQ",
|
31
|
+
"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"
|
32
|
+
)
|
29
33
|
|
30
|
-
#
|
31
|
-
request =
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
# Set request parameters
|
35
|
+
request = {
|
36
|
+
"test": true,
|
37
|
+
"terminalName": "Test Terminal",
|
38
|
+
"amount": "55.00"
|
39
|
+
}
|
35
40
|
|
36
41
|
response = blockchyp.charge(request)
|
37
42
|
|
@@ -109,11 +114,12 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
109
114
|
ENV['BC_SIGNING_KEY']
|
110
115
|
)
|
111
116
|
|
112
|
-
#
|
113
|
-
request = {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
+
# Set request parameters
|
118
|
+
request = {
|
119
|
+
"test": true,
|
120
|
+
"terminalName": 'Test Terminal',
|
121
|
+
"amount": '55.00'
|
122
|
+
}
|
117
123
|
|
118
124
|
response = blockchyp.charge(request)
|
119
125
|
|
@@ -138,11 +144,12 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
138
144
|
ENV['BC_SIGNING_KEY']
|
139
145
|
)
|
140
146
|
|
141
|
-
#
|
142
|
-
request = {
|
143
|
-
|
144
|
-
|
145
|
-
|
147
|
+
# Set request parameters
|
148
|
+
request = {
|
149
|
+
"test": true,
|
150
|
+
"terminalName": 'Test Terminal',
|
151
|
+
"amount": '27.00'
|
152
|
+
}
|
146
153
|
|
147
154
|
response = blockchyp.preauth(request)
|
148
155
|
|
@@ -167,9 +174,10 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
167
174
|
ENV['BC_SIGNING_KEY']
|
168
175
|
)
|
169
176
|
|
170
|
-
#
|
171
|
-
request = {
|
172
|
-
|
177
|
+
# Set request parameters
|
178
|
+
request = {
|
179
|
+
"terminalName": 'Test Terminal'
|
180
|
+
}
|
173
181
|
|
174
182
|
response = blockchyp.ping(request)
|
175
183
|
|
@@ -194,11 +202,12 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
194
202
|
ENV['BC_SIGNING_KEY']
|
195
203
|
)
|
196
204
|
|
197
|
-
#
|
198
|
-
request = {
|
199
|
-
|
200
|
-
|
201
|
-
|
205
|
+
# Set request parameters
|
206
|
+
request = {
|
207
|
+
"test": true,
|
208
|
+
"terminalName": 'Test Terminal',
|
209
|
+
"cardType": CardType::EBT
|
210
|
+
}
|
202
211
|
|
203
212
|
response = blockchyp.balance(request)
|
204
213
|
|
@@ -223,10 +232,11 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
223
232
|
ENV['BC_SIGNING_KEY']
|
224
233
|
)
|
225
234
|
|
226
|
-
#
|
227
|
-
request = {
|
228
|
-
|
229
|
-
|
235
|
+
# Set request parameters
|
236
|
+
request = {
|
237
|
+
"test": true,
|
238
|
+
"terminalName": 'Test Terminal'
|
239
|
+
}
|
230
240
|
|
231
241
|
response = blockchyp.clear(request)
|
232
242
|
|
@@ -251,16 +261,30 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
251
261
|
ENV['BC_SIGNING_KEY']
|
252
262
|
)
|
253
263
|
|
254
|
-
#
|
255
|
-
request = {
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
+
# Set request parameters
|
265
|
+
request = {
|
266
|
+
"test": true,
|
267
|
+
"terminalName": 'Test Terminal',
|
268
|
+
|
269
|
+
# Alias for a Terms and Conditions template configured in the BlockChyp
|
270
|
+
# dashboard.
|
271
|
+
"tcAlias": 'hippa',
|
272
|
+
|
273
|
+
# Name of the contract or document if not using an alias.
|
274
|
+
"tcName": 'HIPPA Disclosure',
|
275
|
+
|
276
|
+
# Full text of the contract or disclosure if not using an alias.
|
277
|
+
"tcContent": 'Full contract text',
|
278
|
+
|
279
|
+
# File format for the signature image.
|
280
|
+
"sigFormat": SignatureFormat::PNG,
|
281
|
+
|
282
|
+
# Width of the signature image in pixels.
|
283
|
+
"sigWidth": 200,
|
284
|
+
|
285
|
+
# Whether or not a signature is required. Defaults to true.
|
286
|
+
"sigRequired": true
|
287
|
+
}
|
264
288
|
|
265
289
|
response = blockchyp.termsAndConditions(request)
|
266
290
|
|
@@ -287,53 +311,34 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
287
311
|
ENV['BC_SIGNING_KEY']
|
288
312
|
)
|
289
313
|
|
290
|
-
#
|
291
|
-
request = {
|
292
|
-
|
293
|
-
|
294
|
-
|
314
|
+
# Set request parameters
|
315
|
+
request = {
|
316
|
+
"test": true,
|
317
|
+
"terminalName": 'Test Terminal',
|
318
|
+
"transaction": {
|
319
|
+
"subtotal": '60.00',
|
320
|
+
"tax": '5.00',
|
321
|
+
"total": '65.00',
|
322
|
+
"items": [
|
323
|
+
{
|
324
|
+
"description": 'Leki Trekking Poles',
|
325
|
+
"price": '35.00',
|
326
|
+
"quantity": 2,
|
327
|
+
"extended": '70.00',
|
328
|
+
"discounts": [
|
329
|
+
{
|
330
|
+
"description": 'memberDiscount',
|
331
|
+
"amount": '10.00'
|
332
|
+
}
|
333
|
+
]
|
334
|
+
}
|
335
|
+
]
|
336
|
+
}
|
337
|
+
}
|
295
338
|
|
296
339
|
response = blockchyp.updateTransactionDisplay(request)
|
297
340
|
|
298
341
|
puts "Response: #{response.inspect}"
|
299
|
-
def new_transaction_display_transaction
|
300
|
-
val = {}
|
301
|
-
val['subtotal'] = '60.00'
|
302
|
-
val['tax'] = '5.00'
|
303
|
-
val['total'] = '65.00'
|
304
|
-
val['items'] = new_transaction_display_items
|
305
|
-
val
|
306
|
-
end
|
307
|
-
|
308
|
-
def new_transaction_display_items
|
309
|
-
val = []
|
310
|
-
val = val.push(new_transaction_display_item_2)
|
311
|
-
val
|
312
|
-
end
|
313
|
-
|
314
|
-
def new_transaction_display_item_2
|
315
|
-
val = {}
|
316
|
-
val['description'] = 'Leki Trekking Poles'
|
317
|
-
val['price'] = '35.00'
|
318
|
-
val['quantity'] = 2
|
319
|
-
val['extended'] = '70.00'
|
320
|
-
val['discounts'] = new_transaction_display_discounts
|
321
|
-
val
|
322
|
-
end
|
323
|
-
|
324
|
-
def new_transaction_display_discounts
|
325
|
-
val = []
|
326
|
-
val = val.push(new_transaction_display_discount_2)
|
327
|
-
val
|
328
|
-
end
|
329
|
-
|
330
|
-
def new_transaction_display_discount_2
|
331
|
-
val = {}
|
332
|
-
val['description'] = 'memberDiscount'
|
333
|
-
val['amount'] = '10.00'
|
334
|
-
val
|
335
|
-
end
|
336
|
-
|
337
342
|
|
338
343
|
|
339
344
|
```
|
@@ -354,53 +359,34 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
354
359
|
ENV['BC_SIGNING_KEY']
|
355
360
|
)
|
356
361
|
|
357
|
-
#
|
358
|
-
request = {
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
+
# Set request parameters
|
363
|
+
request = {
|
364
|
+
"test": true,
|
365
|
+
"terminalName": 'Test Terminal',
|
366
|
+
"transaction": {
|
367
|
+
"subtotal": '60.00',
|
368
|
+
"tax": '5.00',
|
369
|
+
"total": '65.00',
|
370
|
+
"items": [
|
371
|
+
{
|
372
|
+
"description": 'Leki Trekking Poles',
|
373
|
+
"price": '35.00',
|
374
|
+
"quantity": 2,
|
375
|
+
"extended": '70.00',
|
376
|
+
"discounts": [
|
377
|
+
{
|
378
|
+
"description": 'memberDiscount',
|
379
|
+
"amount": '10.00'
|
380
|
+
}
|
381
|
+
]
|
382
|
+
}
|
383
|
+
]
|
384
|
+
}
|
385
|
+
}
|
362
386
|
|
363
387
|
response = blockchyp.newTransactionDisplay(request)
|
364
388
|
|
365
389
|
puts "Response: #{response.inspect}"
|
366
|
-
def new_transaction_display_transaction
|
367
|
-
val = {}
|
368
|
-
val['subtotal'] = '60.00'
|
369
|
-
val['tax'] = '5.00'
|
370
|
-
val['total'] = '65.00'
|
371
|
-
val['items'] = new_transaction_display_items
|
372
|
-
val
|
373
|
-
end
|
374
|
-
|
375
|
-
def new_transaction_display_items
|
376
|
-
val = []
|
377
|
-
val = val.push(new_transaction_display_item_2)
|
378
|
-
val
|
379
|
-
end
|
380
|
-
|
381
|
-
def new_transaction_display_item_2
|
382
|
-
val = {}
|
383
|
-
val['description'] = 'Leki Trekking Poles'
|
384
|
-
val['price'] = '35.00'
|
385
|
-
val['quantity'] = 2
|
386
|
-
val['extended'] = '70.00'
|
387
|
-
val['discounts'] = new_transaction_display_discounts
|
388
|
-
val
|
389
|
-
end
|
390
|
-
|
391
|
-
def new_transaction_display_discounts
|
392
|
-
val = []
|
393
|
-
val = val.push(new_transaction_display_discount_2)
|
394
|
-
val
|
395
|
-
end
|
396
|
-
|
397
|
-
def new_transaction_display_discount_2
|
398
|
-
val = {}
|
399
|
-
val['description'] = 'memberDiscount'
|
400
|
-
val['amount'] = '10.00'
|
401
|
-
val
|
402
|
-
end
|
403
|
-
|
404
390
|
|
405
391
|
|
406
392
|
```
|
@@ -421,11 +407,15 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
421
407
|
ENV['BC_SIGNING_KEY']
|
422
408
|
)
|
423
409
|
|
424
|
-
#
|
425
|
-
request = {
|
426
|
-
|
427
|
-
|
428
|
-
|
410
|
+
# Set request parameters
|
411
|
+
request = {
|
412
|
+
"test": true,
|
413
|
+
"terminalName": 'Test Terminal',
|
414
|
+
|
415
|
+
# Type of prompt. Can be 'email', 'phone', 'customer-number', or
|
416
|
+
# 'rewards-number'.
|
417
|
+
"promptType": PromptType::EMAIL
|
418
|
+
}
|
429
419
|
|
430
420
|
response = blockchyp.textPrompt(request)
|
431
421
|
|
@@ -450,13 +440,14 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
450
440
|
ENV['BC_SIGNING_KEY']
|
451
441
|
)
|
452
442
|
|
453
|
-
#
|
454
|
-
request = {
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
443
|
+
# Set request parameters
|
444
|
+
request = {
|
445
|
+
"test": true,
|
446
|
+
"terminalName": 'Test Terminal',
|
447
|
+
"prompt": 'Would you like to become a member?',
|
448
|
+
"yesCaption": 'Yes',
|
449
|
+
"noCaption": 'No'
|
450
|
+
}
|
460
451
|
|
461
452
|
response = blockchyp.booleanPrompt(request)
|
462
453
|
|
@@ -481,11 +472,12 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
481
472
|
ENV['BC_SIGNING_KEY']
|
482
473
|
)
|
483
474
|
|
484
|
-
#
|
485
|
-
request = {
|
486
|
-
|
487
|
-
|
488
|
-
|
475
|
+
# Set request parameters
|
476
|
+
request = {
|
477
|
+
"test": true,
|
478
|
+
"terminalName": 'Test Terminal',
|
479
|
+
"message": 'Thank you for your business.'
|
480
|
+
}
|
489
481
|
|
490
482
|
response = blockchyp.message(request)
|
491
483
|
|
@@ -510,11 +502,14 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
510
502
|
ENV['BC_SIGNING_KEY']
|
511
503
|
)
|
512
504
|
|
513
|
-
#
|
514
|
-
request = {
|
515
|
-
|
516
|
-
|
517
|
-
|
505
|
+
# Set request parameters
|
506
|
+
request = {
|
507
|
+
"terminalName": 'Test Terminal',
|
508
|
+
"transactionId": '<PREVIOUS TRANSACTION ID>',
|
509
|
+
|
510
|
+
# Optional amount for partial refunds.
|
511
|
+
"amount": '5.00'
|
512
|
+
}
|
518
513
|
|
519
514
|
response = blockchyp.refund(request)
|
520
515
|
|
@@ -539,10 +534,11 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
539
534
|
ENV['BC_SIGNING_KEY']
|
540
535
|
)
|
541
536
|
|
542
|
-
#
|
543
|
-
request = {
|
544
|
-
|
545
|
-
|
537
|
+
# Set request parameters
|
538
|
+
request = {
|
539
|
+
"test": true,
|
540
|
+
"terminalName": 'Test Terminal'
|
541
|
+
}
|
546
542
|
|
547
543
|
response = blockchyp.enroll(request)
|
548
544
|
|
@@ -567,11 +563,12 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
567
563
|
ENV['BC_SIGNING_KEY']
|
568
564
|
)
|
569
565
|
|
570
|
-
#
|
571
|
-
request = {
|
572
|
-
|
573
|
-
|
574
|
-
|
566
|
+
# Set request parameters
|
567
|
+
request = {
|
568
|
+
"test": true,
|
569
|
+
"terminalName": 'Test Terminal',
|
570
|
+
"amount": '50.00'
|
571
|
+
}
|
575
572
|
|
576
573
|
response = blockchyp.giftActivate(request)
|
577
574
|
|
@@ -604,10 +601,11 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
604
601
|
ENV['BC_SIGNING_KEY']
|
605
602
|
)
|
606
603
|
|
607
|
-
#
|
608
|
-
request = {
|
609
|
-
|
610
|
-
|
604
|
+
# Set request parameters
|
605
|
+
request = {
|
606
|
+
"terminalName": 'Test Terminal',
|
607
|
+
"transactionRef": '<LAST TRANSACTION REF>'
|
608
|
+
}
|
611
609
|
|
612
610
|
response = blockchyp.reverse(request)
|
613
611
|
|
@@ -632,10 +630,11 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
632
630
|
ENV['BC_SIGNING_KEY']
|
633
631
|
)
|
634
632
|
|
635
|
-
#
|
636
|
-
request = {
|
637
|
-
|
638
|
-
|
633
|
+
# Set request parameters
|
634
|
+
request = {
|
635
|
+
"test": true,
|
636
|
+
"transactionId": '<PREAUTH TRANSACTION ID>'
|
637
|
+
}
|
639
638
|
|
640
639
|
response = blockchyp.capture(request)
|
641
640
|
|
@@ -660,9 +659,10 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
660
659
|
ENV['BC_SIGNING_KEY']
|
661
660
|
)
|
662
661
|
|
663
|
-
#
|
664
|
-
request = {
|
665
|
-
|
662
|
+
# Set request parameters
|
663
|
+
request = {
|
664
|
+
"test": true
|
665
|
+
}
|
666
666
|
|
667
667
|
response = blockchyp.closeBatch(request)
|
668
668
|
|
@@ -687,10 +687,11 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
687
687
|
ENV['BC_SIGNING_KEY']
|
688
688
|
)
|
689
689
|
|
690
|
-
#
|
691
|
-
request = {
|
692
|
-
|
693
|
-
|
690
|
+
# Set request parameters
|
691
|
+
request = {
|
692
|
+
"test": true,
|
693
|
+
"transactionId": '<PREVIOUS TRANSACTION ID>'
|
694
|
+
}
|
694
695
|
|
695
696
|
response = blockchyp.void(request)
|
696
697
|
|
@@ -715,9 +716,10 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
715
716
|
ENV['BC_SIGNING_KEY']
|
716
717
|
)
|
717
718
|
|
718
|
-
#
|
719
|
-
request = {
|
720
|
-
|
719
|
+
# Set request parameters
|
720
|
+
request = {
|
721
|
+
"terminalName": 'Test Terminal'
|
722
|
+
}
|
721
723
|
|
722
724
|
response = blockchyp.terminalStatus(request)
|
723
725
|
|
@@ -742,11 +744,16 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
742
744
|
ENV['BC_SIGNING_KEY']
|
743
745
|
)
|
744
746
|
|
745
|
-
#
|
746
|
-
request = {
|
747
|
-
|
748
|
-
|
749
|
-
|
747
|
+
# Set request parameters
|
748
|
+
request = {
|
749
|
+
"terminalName": 'Test Terminal',
|
750
|
+
|
751
|
+
# File format for the signature image.
|
752
|
+
"sigFormat": SignatureFormat::PNG,
|
753
|
+
|
754
|
+
# Width of the signature image in pixels.
|
755
|
+
"sigWidth": 200
|
756
|
+
}
|
750
757
|
|
751
758
|
response = blockchyp.captureSignature(request)
|
752
759
|
|
@@ -771,25 +778,22 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
771
778
|
ENV['BC_SIGNING_KEY']
|
772
779
|
)
|
773
780
|
|
774
|
-
#
|
775
|
-
request = {
|
776
|
-
|
781
|
+
# Set request parameters
|
782
|
+
request = {
|
783
|
+
"customer": {
|
784
|
+
"id": 'ID of the customer to update',
|
785
|
+
"customerRef": 'Customer reference string',
|
786
|
+
"firstName": 'FirstName',
|
787
|
+
"lastName": 'LastName',
|
788
|
+
"companyName": 'Company Name',
|
789
|
+
"emailAddress": 'support@blockchyp.com',
|
790
|
+
"smsNumber": '(123) 123-1231'
|
791
|
+
}
|
792
|
+
}
|
777
793
|
|
778
794
|
response = blockchyp.updateCustomer(request)
|
779
795
|
|
780
796
|
puts "Response: #{response.inspect}"
|
781
|
-
def new_customer
|
782
|
-
val = {}
|
783
|
-
val['id'] = 'ID of the customer to update'
|
784
|
-
val['customerRef'] = 'Customer reference string'
|
785
|
-
val['firstName'] = 'FirstName'
|
786
|
-
val['lastName'] = 'LastName'
|
787
|
-
val['companyName'] = 'Company Name'
|
788
|
-
val['emailAddress'] = 'support@blockchyp.com'
|
789
|
-
val['smsNumber'] = '(123) 123-1231'
|
790
|
-
val
|
791
|
-
end
|
792
|
-
|
793
797
|
|
794
798
|
|
795
799
|
```
|
@@ -810,9 +814,10 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
810
814
|
ENV['BC_SIGNING_KEY']
|
811
815
|
)
|
812
816
|
|
813
|
-
#
|
814
|
-
request = {
|
815
|
-
|
817
|
+
# Set request parameters
|
818
|
+
request = {
|
819
|
+
"customerId": 'ID of the customer to retrieve'
|
820
|
+
}
|
816
821
|
|
817
822
|
response = blockchyp.customer(request)
|
818
823
|
|
@@ -837,9 +842,10 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
837
842
|
ENV['BC_SIGNING_KEY']
|
838
843
|
)
|
839
844
|
|
840
|
-
#
|
841
|
-
request = {
|
842
|
-
|
845
|
+
# Set request parameters
|
846
|
+
request = {
|
847
|
+
"query": '(123) 123-1234'
|
848
|
+
}
|
843
849
|
|
844
850
|
response = blockchyp.customerSearch(request)
|
845
851
|
|
@@ -864,9 +870,10 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
864
870
|
ENV['BC_SIGNING_KEY']
|
865
871
|
)
|
866
872
|
|
867
|
-
#
|
868
|
-
request = {
|
869
|
-
|
873
|
+
# Set request parameters
|
874
|
+
request = {
|
875
|
+
"transactionId": 'ID of transaction to retrieve'
|
876
|
+
}
|
870
877
|
|
871
878
|
response = blockchyp.transactionStatus(request)
|
872
879
|
|
@@ -891,52 +898,37 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
891
898
|
ENV['BC_SIGNING_KEY']
|
892
899
|
)
|
893
900
|
|
894
|
-
#
|
895
|
-
request = {
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
901
|
+
# Set request parameters
|
902
|
+
request = {
|
903
|
+
"amount": '199.99',
|
904
|
+
"description": 'Widget',
|
905
|
+
"subject": 'Widget invoice',
|
906
|
+
"transaction": {
|
907
|
+
"subtotal": '195.00',
|
908
|
+
"tax": '4.99',
|
909
|
+
"total": '199.99',
|
910
|
+
"items": [
|
911
|
+
{
|
912
|
+
"description": 'Widget',
|
913
|
+
"price": '195.00',
|
914
|
+
"quantity": 1
|
915
|
+
}
|
916
|
+
]
|
917
|
+
},
|
918
|
+
"autoSend": true,
|
919
|
+
"customer": {
|
920
|
+
"customerRef": 'Customer reference string',
|
921
|
+
"firstName": 'FirstName',
|
922
|
+
"lastName": 'LastName',
|
923
|
+
"companyName": 'Company Name',
|
924
|
+
"emailAddress": 'support@blockchyp.com',
|
925
|
+
"smsNumber": '(123) 123-1231'
|
926
|
+
}
|
927
|
+
}
|
902
928
|
|
903
929
|
response = blockchyp.sendPaymentLink(request)
|
904
930
|
|
905
931
|
puts "Response: #{response.inspect}"
|
906
|
-
def new_transaction_display_transaction
|
907
|
-
val = {}
|
908
|
-
val['subtotal'] = '195.00'
|
909
|
-
val['tax'] = '4.99'
|
910
|
-
val['total'] = '199.99'
|
911
|
-
val['items'] = new_transaction_display_items
|
912
|
-
val
|
913
|
-
end
|
914
|
-
|
915
|
-
def new_transaction_display_items
|
916
|
-
val = []
|
917
|
-
val = val.push(new_transaction_display_item_2)
|
918
|
-
val
|
919
|
-
end
|
920
|
-
|
921
|
-
def new_transaction_display_item_2
|
922
|
-
val = {}
|
923
|
-
val['description'] = 'Widget'
|
924
|
-
val['price'] = '195.00'
|
925
|
-
val['quantity'] = 1
|
926
|
-
val
|
927
|
-
end
|
928
|
-
|
929
|
-
def new_customer
|
930
|
-
val = {}
|
931
|
-
val['customerRef'] = 'Customer reference string'
|
932
|
-
val['firstName'] = 'FirstName'
|
933
|
-
val['lastName'] = 'LastName'
|
934
|
-
val['companyName'] = 'Company Name'
|
935
|
-
val['emailAddress'] = 'support@blockchyp.com'
|
936
|
-
val['smsNumber'] = '(123) 123-1231'
|
937
|
-
val
|
938
|
-
end
|
939
|
-
|
940
932
|
|
941
933
|
|
942
934
|
```
|