pci_proxy 1.2.0 → 1.2.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: 6a88f474d4153735ec851a18cbdfc91aded2a3b9ab310b29887e9a05e3943fc9
4
- data.tar.gz: 46fb731fb0604451d084d29bf8cf0c1d7ab7e54475447fe22a594379fbd6d8ff
3
+ metadata.gz: 47c687f9c8597bf60929b77d33f0849ed847381885eb7a17a82e1658e98a35bc
4
+ data.tar.gz: 361afd9f1839a8661cf9116ba4739e7844e290a974cc0a745721683ac09df7b3
5
5
  SHA512:
6
- metadata.gz: 43fb21c87681f6c3953259561beb31196231ff75e5b0d7df470c204f301c2a3d0e9230598d0c02dcc1295a7635b8a1bfa6044745e8c523256355f96a5ffdc295
7
- data.tar.gz: 99d59b3029c316d64325a003b3f835bb9e0aeccda201450119f72bfccf7dc0e280a33bdd091283028a3f5ea2290d6442caee3d531196e063bd4476769c405f6b
6
+ metadata.gz: 2c93bb9d784fdd2e513cdb37b7a3168997563307068f552f2071cc6a5d9f1d0d503fd4c860866e8dc640bd5921b1f2b30c153525a0283d8a12242468e4e55787
7
+ data.tar.gz: 74047acd5ee6bc8f197fb25d4bcb90e9ff84cd9bd73809281d0bc624ebbbf927fefebcbb792918e09b98d8dcbf557192b3875e7f3c8124c90ad7e42657094bcf
data/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A simple client library for [PCI Proxy](https://pci-proxy.com)'s API
4
4
 
5
+ v1.2.1 - 30th January 2020 - Minor tweaks; cleanups; update documentation
6
+
5
7
  v1.2.0 - 30th January 2020 - Add support for the [Check API](https://docs.pci-proxy.com/use-stored-cards/check)
6
8
 
7
9
  v1.1.0 - 17th January 2020 - Return an instance of PciProxy::Model::TokenisedCard instead of plain Hash
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pci_proxy (1.1.0)
4
+ pci_proxy (1.2.0)
5
5
  faraday (>= 0.8.9)
6
6
  multi_json (>= 1.10.0)
7
7
 
@@ -26,4 +26,4 @@ DEPENDENCIES
26
26
  rake (~> 10.0)
27
27
 
28
28
  BUNDLED WITH
29
- 2.1.2
29
+ 2.1.4
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- Initially, this gem only covers the [Token API](https://docs.pci-proxy.com/collect-and-store-cards/capture-iframes/token-api), which converts a transactionId from the [secure fields](https://docs.pci-proxy.com/collect-and-store-cards/capture-iframes) mechanism into tokenised card PAN and CVV.
23
+ Initially, this gem only covers the [Token API](https://docs.pci-proxy.com/collect-and-store-cards/capture-iframes/token-api), which converts a transactionId from the [secure fields](https://docs.pci-proxy.com/collect-and-store-cards/capture-iframes) mechanism into tokenised card PAN and CVV, and the [Check API](https://docs.pci-proxy.com/use-stored-cards/check) which allows verification of a card token.
24
24
 
25
25
  Pull requests are most welcome for coverage of other PCI Proxy APIs :)
26
26
  ### Token API - Usage
@@ -38,8 +38,17 @@ client.execute(transaction_id: '1234567890')
38
38
  In the event of a 200 OK response, an instance of PciProxy::Model::TokenisedCard is returned:
39
39
 
40
40
  ```ruby
41
- #<PciProxy::Model::TokenisedCard:0x00007fda073453f8 @response={"aliasCC"=>"411111GGCMUJ1111", "aliasCVV"=>"b8XeAbhQQES6OVWTpOCaAscj", "paymentMethod"=>"VIS"}, @pan_token="411111GGCMUJ1111", @cvv_token="b8XeAbhQQES6OVWTpOCaAscj", @type_slug=:visa>
41
+ #<PciProxy::Model::TokenisedCard:0x00007fda073453f8 @pan_token="411111GGCMUJ1111", @cvv_token="b8XeAbhQQES6OVWTpOCaAscj", @type_slug=:visa>
42
42
  ```
43
+ (```response``` attr_reader value omitted for clarity)
44
+
45
+ This object has attr_readers for ```pan_token```, ```cvv_token``` and ```type_slug``` which will return one of the following symbols:
46
+
47
+ ```ruby
48
+ [:visa, :mastercard, :amex, :diners, :discovery, :jcb, :elo, :cup, :unknown]
49
+ ```
50
+
51
+ It also has an attr_reader for ```response``` which is the raw parsed JSON response, as a hash.
43
52
 
44
53
  In the event of an error, a subclass of ```PciProxyAPIError``` will be raised.
45
54
 
@@ -49,6 +58,38 @@ The most likely error is that the transactionId temporary token has expired, res
49
58
  PciProxy::BadRequestError (HTTP status: 400, Response: Tokenization not found)
50
59
  ```
51
60
 
61
+ ### Check API - Usage
62
+
63
+ Create an instance of ```PciProxy::Check``` and call ```execute``` as follows:
64
+
65
+ ```ruby
66
+ client = PciProxy::Check.new(api_username: 'username', api_password: 'password')
67
+ ```
68
+
69
+ And execute a card verification like so:
70
+
71
+ ```ruby
72
+ client.execute(reference: 'foo', card_token: '411111GGCMUJ1111', card_type: :visa, expiry_month: 1, expiry_year: 2022)
73
+ ```
74
+
75
+ In all cases (success, denoted by 200 OK from the API, or error, denoted by non-200 response), an instance of ```PciProxy::Model::CheckResult``` is returned.
76
+
77
+ This object has attr_readers for ```auth_code```, ```transaction_id```, ```status``` and ```error```
78
+
79
+ It also has an attr_reader for ```response``` which is the raw parsed JSON response, as a hash.
80
+
81
+ With a successful response, the object's ```status``` attribute will have the value ```:success```, and the ```auth_code``` and ```transaction_id``` values will be available:
82
+ ```ruby
83
+ #<PciProxy::Model::CheckResult:0x00007fbda2186fe8 @auth_code="124101", @transaction_id="190828124101219812", @error=nil, @status=:success>
84
+ ```
85
+ (```response``` attr_reader value omitted for clarity)
86
+
87
+ With an unsuccessful response, the object's ```status``` attribute will have the value ```:error```:
88
+ ```ruby
89
+ #<PciProxy::Model::CheckResult:0x00007fbda2186fe8 @auth_code=nil, @transaction_id=nil, @error={"code"=>"UNAUTHORIZED", "message"=>"The account is not configured to use this API."}, @status=:error>
90
+ ```
91
+ (```response``` attr_reader value omitted for clarity)
92
+
52
93
  ## Changes
53
94
  See [Changelog](CHANGELOG.md)
54
95
 
@@ -10,7 +10,7 @@ module PciProxy
10
10
  @transaction_id = response["transactionId"]
11
11
  @error = response["error"]
12
12
 
13
- @status = @auth_code && @transaction_id && !@error ? 'success' : 'error'
13
+ @status = @auth_code && @transaction_id && !@error ? :success : :error
14
14
  end
15
15
 
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module PciProxy
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pci_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rory Sinclair