blockchyp 2.3.4 → 2.3.5
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 +193 -34
- data/lib/blockchyp.rb +15 -0
- data/lib/blockchyp/version.rb +1 -1
- data/test/batch_history_test.rb +48 -0
- data/test/transaction_history_test.rb +48 -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: 5ca711b2e47c0391a4d2bae6df5f33eb9585fca0aec4121aa2a26bf6a96a2516
|
4
|
+
data.tar.gz: e63cfc05d92201d6ed4d30f6f0e7f83aa5224b8fbc54b34b8845e427bcef52f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95113934892b77a450f0b9b0c69a4cd61721fd4cdf4286b73f99c9420ffeab10c7cdc892af18901b550731fa2a5579c76b28369031edac105075d00b7421fc25
|
7
|
+
data.tar.gz: c899ac8ef7ecf482d9e99102a4d8af54845d8f63d11522fc73ec9b0c1c3e17cb80a244d71f1b075ec5cdca42e6274bc3d957a6a4ea47681b9438d741b14077e7
|
data/README.md
CHANGED
@@ -147,7 +147,7 @@ might be maliciously running on the point-of-sale system.
|
|
147
147
|
* **Cash Back**: To enable cash back for debit transactions, set the `cashBack` flag. If the card presented isn't a debit card, the `cashBack` flag will be ignored.
|
148
148
|
* **Manual Card Entry**: Set the `manual` flag to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the `manual` flag with the `ebt` flag for manual EBT card entry.
|
149
149
|
* **Inline Tokenization**: You can enroll the payment method in the token vault inline with a charge transaction by setting the `enroll` flag. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
|
150
|
-
* **Prompting for Tips**: Set the `promptForTips` flag if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other
|
150
|
+
* **Prompting for Tips**: Set the `promptForTips` flag if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios.
|
151
151
|
* **Cash Discounting and Surcharging**: The `surcharge` and `cashDiscount` flags can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
|
152
152
|
|
153
153
|
|
@@ -182,8 +182,8 @@ puts "Response: #{response.inspect}"
|
|
182
182
|
|
183
183
|
|
184
184
|
A preauthorization puts a hold on funds and must be captured later. This is used
|
185
|
-
in scenarios where the final transaction amount might change.
|
186
|
-
be fine dining where a tip adjustment is required prior to
|
185
|
+
in scenarios where the final transaction amount might change. A common examples would
|
186
|
+
be fine dining where a tip adjustment is required prior to final settlement.
|
187
187
|
|
188
188
|
Another use case for preauthorization is e-commerce. Typically, an online order
|
189
189
|
is preauthorized at the time of the order and then captured when the order ships.
|
@@ -293,14 +293,14 @@ returned in a BlockChyp response. To refund the full amount of the previous tra
|
|
293
293
|
|
294
294
|
**Partial Refunds**
|
295
295
|
|
296
|
-
For a partial refund, just
|
296
|
+
For a partial refund, just pass in an amount along with the Transaction ID.
|
297
297
|
The only rule is that the amount has to be equal to or less than the original
|
298
|
-
transaction. You can
|
299
|
-
original transaction as long as the total refunded amount doesn't exceed the original
|
298
|
+
transaction. You can execute multiple partial refunds against the same
|
299
|
+
original transaction as long as the total refunded amount doesn't exceed the original amount.
|
300
300
|
|
301
301
|
**Tokenized Refunds**
|
302
302
|
|
303
|
-
You can also use a token to execute a refund.
|
303
|
+
You can also use a token to execute a refund. Pass in a token instead
|
304
304
|
of the Transaction ID along with the desired refund amount.
|
305
305
|
|
306
306
|
**Free Range Refunds**
|
@@ -308,10 +308,10 @@ of the Transaction ID along with the desired refund amount.
|
|
308
308
|
When you execute a refund without referencing a previous transaction, we
|
309
309
|
call this a *free range refund*.
|
310
310
|
|
311
|
-
We don't recommend it, but it is permitted.
|
312
|
-
Terminal Name and an amount.
|
311
|
+
We don't recommend it, but it is permitted. If you absolutely insist on
|
312
|
+
doing it, pass in a Terminal Name and an amount.
|
313
313
|
|
314
|
-
You can
|
314
|
+
You can execute a manual or keyed refund by passing the `manual` flag
|
315
315
|
to a free range refund request.
|
316
316
|
|
317
317
|
**Gift Card Refunds**
|
@@ -346,7 +346,6 @@ blockchyp = BlockChyp::BlockChyp.new(
|
|
346
346
|
|
347
347
|
# Set request parameters
|
348
348
|
request = {
|
349
|
-
"terminalName": 'Test Terminal',
|
350
349
|
"transactionId": '<PREVIOUS TRANSACTION ID>',
|
351
350
|
|
352
351
|
# Optional amount for partial refunds.
|
@@ -455,13 +454,13 @@ are retried during shaky network conditions.
|
|
455
454
|
We highly recommend developers use this API whenever a charge, preauth, or refund transaction times out. If you don't receive a definitive response
|
456
455
|
from BlockChyp, you can't be certain about whether or not the transaction went through.
|
457
456
|
|
458
|
-
|
457
|
+
The best practice in this situation is to send a time out reversal request. Time out reversals check for a transaction and void it if it exists.
|
459
458
|
|
460
459
|
The only caveat is that developers must use the `transactionRef` property (`txRef` for the CLI) when executing charge, preauth, and refund transactions.
|
461
460
|
|
462
461
|
The reason for this requirement is that if a system never receives a definitive
|
463
462
|
response for a transaction, the system would never have received the BlockChyp
|
464
|
-
generated Transaction ID. We have to fallback to
|
463
|
+
generated Transaction ID. We have to fallback to Transaction Ref to identify
|
465
464
|
a transaction.
|
466
465
|
|
467
466
|
|
@@ -498,7 +497,7 @@ Just pass in the terminal name and the amount to add to the card.
|
|
498
497
|
Once the customer swipes their card, the terminal will use keys
|
499
498
|
on the mag stripe to add value to the card.
|
500
499
|
|
501
|
-
You don't need to handle a new gift card or a gift card recharge any
|
500
|
+
You don't need to handle a new gift card activation or a gift card recharge any
|
502
501
|
differently. The terminal firmware will figure out what to do on its
|
503
502
|
own and also returns the new balance for the gift card.
|
504
503
|
|
@@ -508,8 +507,7 @@ use gift card numbers. This means they can't be stolen.
|
|
508
507
|
|
509
508
|
BlockChyp identifies cards with an elliptic curve public key instead.
|
510
509
|
Gift card transactions are actually blocks signed with those keys.
|
511
|
-
This means there are no shared secrets sent over the network
|
512
|
-
BlockChyp gift cards.
|
510
|
+
This means there are no shared secrets sent over the network.
|
513
511
|
To keep track of a BlockChyp gift card, hang on to the **public key** returned
|
514
512
|
during gift card activation. That's the gift card's elliptic curve public key.
|
515
513
|
|
@@ -531,7 +529,7 @@ voiding or reversing a conventional payment transaction.
|
|
531
529
|
BlockChyp does have the ability to import gift card liability from
|
532
530
|
conventional gift card platforms. Unfortunately, BlockChyp does not
|
533
531
|
support activating cards on third party systems, but you can import
|
534
|
-
your outstanding gift cards and
|
532
|
+
your outstanding gift cards and customers can swipe them on the
|
535
533
|
terminals just like BlockChyp's standard gift cards.
|
536
534
|
|
537
535
|
No special coding is required to access this feature. The gateway and
|
@@ -540,8 +538,10 @@ terminal firmware handle everything for you.
|
|
540
538
|
**Third Party Gift Card Networks**
|
541
539
|
|
542
540
|
BlockChyp does not currently provide any native support for other gift card
|
543
|
-
platforms beyond importing gift card liability. We do have a white listing system
|
544
|
-
|
541
|
+
platforms beyond importing gift card liability. We do have a white listing system
|
542
|
+
that can be used to support your own custom gift card implementations. We have a security review
|
543
|
+
process before we allow a BIN range to be white listed, so contact
|
544
|
+
support@blockchyp.com if you need to white list a BIN range.
|
545
545
|
|
546
546
|
|
547
547
|
|
@@ -592,7 +592,7 @@ enter a PIN code. If everything checks out, the remaining balance on the card w
|
|
592
592
|
|
593
593
|
**Testing Gift Card Balance Checks**
|
594
594
|
|
595
|
-
Test gift card balance checks
|
595
|
+
Test gift card balance checks work no differently than live gift cards. You
|
596
596
|
must activate a test gift card first in order to test balance checks. Test
|
597
597
|
gift cards are real blockchain cards that live on our parallel test blockchain.
|
598
598
|
|
@@ -632,7 +632,7 @@ puts "Response: #{response.inspect}"
|
|
632
632
|
#### Close Batch
|
633
633
|
|
634
634
|
|
635
|
-
This API will close the merchant's batch
|
635
|
+
This API will close the merchant's batch if it's currently open.
|
636
636
|
|
637
637
|
By default, merchant batches will close automatically at 3 AM in their
|
638
638
|
local time zone. The automatic batch closure time can be changed
|
@@ -698,28 +698,28 @@ for terminal line item display, so the same code can be used to support both are
|
|
698
698
|
|
699
699
|
You can also provide a free form description or message that's displayed near
|
700
700
|
the bottom of the invoice. Usually this is some kind of thank you note
|
701
|
-
or
|
701
|
+
or instruction.
|
702
702
|
|
703
703
|
**Terms and Conditions**
|
704
704
|
|
705
705
|
You can include long form contract language with a request and capture
|
706
706
|
terms and conditions acceptance at the same time payment is captured.
|
707
707
|
|
708
|
-
The interface is identical to that used for the terminal based
|
709
|
-
|
710
|
-
a preconfigured template via `tcAlias`. The
|
711
|
-
|
708
|
+
The interface is identical to that used for the terminal based Terms and
|
709
|
+
Conditions API in that you can pass in content directly via `tcContent` or via
|
710
|
+
a preconfigured template via `tcAlias`. The Terms and Conditions log will also be updated when
|
711
|
+
agreement acceptance is incorporated into a send link request.
|
712
712
|
|
713
713
|
**Auto Send**
|
714
714
|
|
715
|
-
|
716
|
-
|
715
|
+
BlockChyp does not send the email notification automatically. This is
|
716
|
+
a safeguard to prevent real emails from going out when you may not expect it.
|
717
717
|
If you want BlockChyp to send the email for you, just add the `autoSend` flag with
|
718
718
|
all requests.
|
719
719
|
|
720
720
|
**Cashier Facing Card Entry**
|
721
721
|
|
722
|
-
BlockChyp can be used to generate internal/cashier facing
|
722
|
+
BlockChyp can be used to generate internal/cashier facing card entry pages as well. This is
|
723
723
|
designed for situations where you might need to take a phone order and you don't
|
724
724
|
have a terminal.
|
725
725
|
|
@@ -734,7 +734,7 @@ notifying them that the payment was received.
|
|
734
734
|
|
735
735
|
**Real Time Callback Notifications**
|
736
736
|
|
737
|
-
Email notifications are fine, but you may
|
737
|
+
Email notifications are fine, but you may want your system to be informed
|
738
738
|
immediately whenever a payment event occurs. By using the optional `callbackUrl` request
|
739
739
|
property, you can specify a URL to which the Authorization Response will be posted
|
740
740
|
every time the user submits a payment, whether approved or otherwise.
|
@@ -886,7 +886,7 @@ will also return the timestamp of the last status change in the `since` field.
|
|
886
886
|
|
887
887
|
If the system is running a payment transaction and you wisely passed in a
|
888
888
|
Transaction Ref, this API will also return the Transaction Ref of the in progress
|
889
|
-
transaction
|
889
|
+
transaction.
|
890
890
|
|
891
891
|
|
892
892
|
|
@@ -919,7 +919,7 @@ puts "Response: #{response.inspect}"
|
|
919
919
|
|
920
920
|
|
921
921
|
This API allows you to prompt a customer to accept a legal agreement on the terminal
|
922
|
-
and
|
922
|
+
and (usually) capture their signature.
|
923
923
|
|
924
924
|
Content for the agreement can be specified in two ways. You can reference a
|
925
925
|
previously configured T&C template or pass in the full agreement text with every request.
|
@@ -940,12 +940,12 @@ pass in the contract text. Note that only plain text is supported.
|
|
940
940
|
**Bypassing Signatures**
|
941
941
|
|
942
942
|
Signature images are captured by default. If for some reason this doesn't fit your
|
943
|
-
use case and you'd like to capture acceptance without actually capturing a signature image set
|
943
|
+
use case and you'd like to capture acceptance without actually capturing a signature image, set
|
944
944
|
the `disableSignature` flag in the request.
|
945
945
|
|
946
946
|
**Terms & Conditions Log**
|
947
947
|
|
948
|
-
Every time a user accepts an agreement on the terminal the signature image (if captured),
|
948
|
+
Every time a user accepts an agreement on the terminal, the signature image (if captured),
|
949
949
|
will be uploaded to the gateway and added to the log along with the full text of the
|
950
950
|
agreement. This preserves the historical record in the event that standard agreements
|
951
951
|
or templates change over time.
|
@@ -1513,6 +1513,165 @@ response = blockchyp.cashDiscount(request)
|
|
1513
1513
|
puts "Response: #{response.inspect}"
|
1514
1514
|
|
1515
1515
|
|
1516
|
+
```
|
1517
|
+
|
1518
|
+
#### Batch History
|
1519
|
+
|
1520
|
+
|
1521
|
+
|
1522
|
+
This endpoint allows developers to query the gateway for the merchant's batch history.
|
1523
|
+
The data will be returned in descending order of open date with the most recent
|
1524
|
+
batch returned first. The results will include basic information about the batch.
|
1525
|
+
For more detail about a specific batch, consider using the Batch Details API.
|
1526
|
+
|
1527
|
+
**Limiting Results**
|
1528
|
+
|
1529
|
+
This API will return a maximum of 250 results. Use the `maxResults` property to
|
1530
|
+
limit maximum results even further and use the `startIndex` property to
|
1531
|
+
page through results that span multiple queries.
|
1532
|
+
|
1533
|
+
For example, if you want the ten most recent batches, just pass in a value of
|
1534
|
+
`10` for `maxResults`. Also note that `startIndex` is zero based. Use a value of `0` to
|
1535
|
+
get the first batch in the dataset.
|
1536
|
+
|
1537
|
+
**Filtering By Date Range**
|
1538
|
+
|
1539
|
+
You can also filter results by date. Use the `startDate` and `endDate`
|
1540
|
+
properties to return only those batches opened between those dates.
|
1541
|
+
You can use either `startDate` and `endDate` and you can use date filters
|
1542
|
+
in conjunction with `maxResults` and `startIndex`
|
1543
|
+
|
1544
|
+
|
1545
|
+
|
1546
|
+
|
1547
|
+
```ruby
|
1548
|
+
# frozen_string_literal: true
|
1549
|
+
|
1550
|
+
require 'blockchyp'
|
1551
|
+
|
1552
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1553
|
+
ENV['BC_API_KEY'],
|
1554
|
+
ENV['BC_BEARER_TOKEN'],
|
1555
|
+
ENV['BC_SIGNING_KEY']
|
1556
|
+
)
|
1557
|
+
|
1558
|
+
# Set request parameters
|
1559
|
+
request = {
|
1560
|
+
"maxResults": 250,
|
1561
|
+
"startIndex": 1
|
1562
|
+
}
|
1563
|
+
|
1564
|
+
response = blockchyp.batchHistory(request)
|
1565
|
+
|
1566
|
+
puts "Response: #{response.inspect}"
|
1567
|
+
|
1568
|
+
|
1569
|
+
```
|
1570
|
+
|
1571
|
+
#### Batch Details
|
1572
|
+
|
1573
|
+
|
1574
|
+
|
1575
|
+
This endpoint allows developers to pull down details for a specific batch,
|
1576
|
+
including captured volume, gift card activity, expected deposit, and
|
1577
|
+
captured volume broken down by terminal.
|
1578
|
+
|
1579
|
+
The only required request parameter is `batchId`. Batch IDs are returned
|
1580
|
+
with every transaction response and can also be discovered using the Batch
|
1581
|
+
History API.
|
1582
|
+
|
1583
|
+
|
1584
|
+
|
1585
|
+
|
1586
|
+
```ruby
|
1587
|
+
# frozen_string_literal: true
|
1588
|
+
|
1589
|
+
require 'blockchyp'
|
1590
|
+
|
1591
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1592
|
+
ENV['BC_API_KEY'],
|
1593
|
+
ENV['BC_BEARER_TOKEN'],
|
1594
|
+
ENV['BC_SIGNING_KEY']
|
1595
|
+
)
|
1596
|
+
|
1597
|
+
# Set request parameters
|
1598
|
+
request = {
|
1599
|
+
"batchId": 'BATCHID'
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
response = blockchyp.batchDetails(request)
|
1603
|
+
|
1604
|
+
puts "Response: #{response.inspect}"
|
1605
|
+
|
1606
|
+
|
1607
|
+
```
|
1608
|
+
|
1609
|
+
#### Transaction History
|
1610
|
+
|
1611
|
+
|
1612
|
+
|
1613
|
+
This endpoint provides a number of different methods to sift through
|
1614
|
+
transaction history.
|
1615
|
+
|
1616
|
+
By default with no filtering properties, this endpoint will return the 250
|
1617
|
+
most recent transactions.
|
1618
|
+
|
1619
|
+
**Limiting Results**
|
1620
|
+
|
1621
|
+
This API will return a maximum of 250 results in a single query. Use the `maxResults` property
|
1622
|
+
to limit maximum results even further and use the `startIndex` property to
|
1623
|
+
page through results that span multiple queries.
|
1624
|
+
|
1625
|
+
For example, if you want the ten most recent batches, just pass in a value of
|
1626
|
+
`10` for `maxResults`. Also note that `startIndex` is zero based. Use a value of `0` to
|
1627
|
+
get the first transaction in the dataset.
|
1628
|
+
|
1629
|
+
**Filtering By Date Range**
|
1630
|
+
|
1631
|
+
You can also filter results by date. Use the `startDate` and `endDate`
|
1632
|
+
properties to return only transactions run between those dates.
|
1633
|
+
You can use either `startDate` or `endDate` and you can use date filters
|
1634
|
+
in conjunction with `maxResults` and `startIndex`
|
1635
|
+
|
1636
|
+
**Filtering By Batch**
|
1637
|
+
|
1638
|
+
To restrict results to a single batch, pass in the `batchId` parameter.
|
1639
|
+
|
1640
|
+
**Filtering By Terminal**
|
1641
|
+
|
1642
|
+
To restrict results to those executed on a single terminal, just
|
1643
|
+
pass in the terminal name.
|
1644
|
+
|
1645
|
+
**Combining Filters**
|
1646
|
+
|
1647
|
+
None of the above filters are mutually exclusive. You can combine any of the
|
1648
|
+
above properties in a single request to restrict transaction results to a
|
1649
|
+
narrower set of results.
|
1650
|
+
|
1651
|
+
|
1652
|
+
|
1653
|
+
|
1654
|
+
```ruby
|
1655
|
+
# frozen_string_literal: true
|
1656
|
+
|
1657
|
+
require 'blockchyp'
|
1658
|
+
|
1659
|
+
blockchyp = BlockChyp::BlockChyp.new(
|
1660
|
+
ENV['BC_API_KEY'],
|
1661
|
+
ENV['BC_BEARER_TOKEN'],
|
1662
|
+
ENV['BC_SIGNING_KEY']
|
1663
|
+
)
|
1664
|
+
|
1665
|
+
# Set request parameters
|
1666
|
+
request = {
|
1667
|
+
"maxResults": 10
|
1668
|
+
}
|
1669
|
+
|
1670
|
+
response = blockchyp.transactionHistory(request)
|
1671
|
+
|
1672
|
+
puts "Response: #{response.inspect}"
|
1673
|
+
|
1674
|
+
|
1516
1675
|
```
|
1517
1676
|
|
1518
1677
|
## Running Integration Tests
|
data/lib/blockchyp.rb
CHANGED
@@ -191,5 +191,20 @@ module BlockChyp
|
|
191
191
|
gateway_request('POST', '/api/cash-discount', request)
|
192
192
|
end
|
193
193
|
|
194
|
+
# Returns the batch history for a merchant.
|
195
|
+
def batch_history(request)
|
196
|
+
gateway_request('POST', '/api/batch-history', request)
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns the batch details for a single batch.
|
200
|
+
def batch_details(request)
|
201
|
+
gateway_request('POST', '/api/batch-details', request)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the transaction history for a merchant.
|
205
|
+
def transaction_history(request)
|
206
|
+
gateway_request('POST', '/api/tx-history', request)
|
207
|
+
end
|
208
|
+
|
194
209
|
end
|
195
210
|
end
|
data/lib/blockchyp/version.rb
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2019 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. Changes to this file will be lost
|
7
|
+
# every time the code is regenerated.
|
8
|
+
|
9
|
+
require ::File.expand_path('test_helper', __dir__)
|
10
|
+
|
11
|
+
module BlockChyp
|
12
|
+
class BatchHistoryTest < TestCase
|
13
|
+
def test_batch_history
|
14
|
+
config = load_test_config
|
15
|
+
|
16
|
+
blockchyp = BlockChyp.new(
|
17
|
+
config['apiKey'],
|
18
|
+
config['bearerToken'],
|
19
|
+
config['signingKey']
|
20
|
+
)
|
21
|
+
blockchyp.gateway_host = config['gatewayHost']
|
22
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
23
|
+
|
24
|
+
test_delay(blockchyp, 'batch_history_test')
|
25
|
+
|
26
|
+
# Set request parameters
|
27
|
+
setup_request = {
|
28
|
+
"pan": '4111111111111111',
|
29
|
+
"amount": '25.55',
|
30
|
+
"test": true,
|
31
|
+
"transactionRef": uuid
|
32
|
+
}
|
33
|
+
|
34
|
+
response = blockchyp.charge(setup_request)
|
35
|
+
|
36
|
+
# Set request parameters
|
37
|
+
request = {
|
38
|
+
"maxResults": 10
|
39
|
+
}
|
40
|
+
|
41
|
+
response = blockchyp.batch_history(request)
|
42
|
+
|
43
|
+
assert_not_nil(response)
|
44
|
+
# response assertions
|
45
|
+
assert(response['success'])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2019 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. Changes to this file will be lost
|
7
|
+
# every time the code is regenerated.
|
8
|
+
|
9
|
+
require ::File.expand_path('test_helper', __dir__)
|
10
|
+
|
11
|
+
module BlockChyp
|
12
|
+
class TransactionHistoryTest < TestCase
|
13
|
+
def test_transaction_history
|
14
|
+
config = load_test_config
|
15
|
+
|
16
|
+
blockchyp = BlockChyp.new(
|
17
|
+
config['apiKey'],
|
18
|
+
config['bearerToken'],
|
19
|
+
config['signingKey']
|
20
|
+
)
|
21
|
+
blockchyp.gateway_host = config['gatewayHost']
|
22
|
+
blockchyp.test_gateway_host = config['testGatewayHost']
|
23
|
+
|
24
|
+
test_delay(blockchyp, 'transaction_history_test')
|
25
|
+
|
26
|
+
# Set request parameters
|
27
|
+
setup_request = {
|
28
|
+
"pan": '4111111111111111',
|
29
|
+
"amount": '25.55',
|
30
|
+
"test": true,
|
31
|
+
"transactionRef": uuid
|
32
|
+
}
|
33
|
+
|
34
|
+
response = blockchyp.charge(setup_request)
|
35
|
+
|
36
|
+
# Set request parameters
|
37
|
+
request = {
|
38
|
+
"maxResults": 10
|
39
|
+
}
|
40
|
+
|
41
|
+
response = blockchyp.transaction_history(request)
|
42
|
+
|
43
|
+
assert_not_nil(response)
|
44
|
+
# response assertions
|
45
|
+
assert(response['success'])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
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.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BlockChyp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -23,6 +23,7 @@ files:
|
|
23
23
|
- lib/blockchyp/version.rb
|
24
24
|
- lib/blockchyp_client.rb
|
25
25
|
- lib/crypto_utils.rb
|
26
|
+
- test/batch_history_test.rb
|
26
27
|
- test/boolean_prompt_test.rb
|
27
28
|
- test/capture_signature_test.rb
|
28
29
|
- test/gateway_timeout_test.rb
|
@@ -56,6 +57,7 @@ files:
|
|
56
57
|
- test/terms_and_conditions_test.rb
|
57
58
|
- test/test_helper.rb
|
58
59
|
- test/text_prompt_test.rb
|
60
|
+
- test/transaction_history_test.rb
|
59
61
|
- test/update_customer_test.rb
|
60
62
|
- test/update_transaction_display_test.rb
|
61
63
|
homepage: https://github.com/blockchyp/blockchyp-ruby
|