figpay_gateway 1.0.0 → 1.0.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/.gitignore +1 -1
- data/.ruby-version +1 -0
- data/README.md +12 -1
- data/lib/figpay_gateway/version.rb +1 -1
- data/lib/nmi_gateway/api.rb +4 -1
- data/lib/nmi_gateway/customer_vault.rb +6 -2
- data/lib/nmi_gateway/response.rb +6 -1
- data/lib/nmi_gateway/transaction.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d59cba6b47a82b9e89b53596dfacbab9d878a5d4d9cea9d8203c7b86f16437ad
|
|
4
|
+
data.tar.gz: a1c7b968a83539aff97dd6ca9ecbcb036b7618ade945572ac6221a3c4aaf96ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 38b028203836e1051721ea735c616c331632833cda9eb0f15e15d9b0fa73236db8d433eb1f6715c8c692db56b918b45e3381c5d30f6738d4a214520fb6c1e8f3
|
|
7
|
+
data.tar.gz: cc42df57043042e8daa71c4648d0698af797432390d8f00fb2df31f6fbc39c7ef7ac0355d4ec140ab8bccab6613d2b0f9b95b89dbad5acaf00a34eef3928f538
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.4.5
|
data/README.md
CHANGED
|
@@ -86,6 +86,17 @@ The FigPay Gateway library is organized around three main API sets:
|
|
|
86
86
|
|
|
87
87
|
Process credit card transactions including sales, authorizations, captures, and refunds.
|
|
88
88
|
|
|
89
|
+
#### Recommendation - use collect.js to tokenize cards client side
|
|
90
|
+
|
|
91
|
+
The payment gateway supports credit card tokenization via [Collect.js](https://figpay.transactiongateway.com//merchants/resources/integration/integration_portal.php#cjs_methodology). The benefit of this approach is that sensitive PCI information will be submitted directly to payment processor servers, they will return a token that you would send back to your servers, and reduce the PCI SAQ compliance requirements from SAQ-C or SAQ-D to SAQ-A. This greatly simplifies compliance, as no credit information would ever touch your logs or servers.
|
|
92
|
+
|
|
93
|
+
Test Token example: `00000000-000000-000000-000000000000`
|
|
94
|
+
This is tied to a test card: `Card: 4111111111111111, Expiration: October 2025, CVV: 999`
|
|
95
|
+
|
|
96
|
+
Usage, in all examples, rather than passing in `ccnumber` and `ccexp`, these can be updated to use the token obtained via Collect.js and passed in as a `payment_token` param instead.
|
|
97
|
+
|
|
98
|
+
There is a Test Public Key that can be used with Collect.js: `48r3R6-M39Jx5-467srN-VWVbD3`
|
|
99
|
+
|
|
89
100
|
#### Create a Sale
|
|
90
101
|
|
|
91
102
|
Process a direct sale (authorization and capture combined):
|
|
@@ -186,7 +197,7 @@ Retrieve transaction details:
|
|
|
186
197
|
|
|
187
198
|
```ruby
|
|
188
199
|
details = FigpayGateway::Transaction.new.find(
|
|
189
|
-
|
|
200
|
+
transaction_id: '3261844010'
|
|
190
201
|
)
|
|
191
202
|
```
|
|
192
203
|
|
data/lib/nmi_gateway/api.rb
CHANGED
|
@@ -67,6 +67,9 @@ module NMIGateway
|
|
|
67
67
|
query[:ccexp] = options[:ccexp] # FORMAT MMYY
|
|
68
68
|
query[:cvv] = options[:cvv] # Recommended
|
|
69
69
|
|
|
70
|
+
# Payment Token
|
|
71
|
+
query[:payment_token] = options[:payment_token] # from Collect.js
|
|
72
|
+
|
|
70
73
|
# Payment
|
|
71
74
|
query[:amount] = options[:amount]
|
|
72
75
|
query[:currency] = options[:currency] || 'USD'
|
|
@@ -83,7 +86,7 @@ module NMIGateway
|
|
|
83
86
|
# Recurring Billing
|
|
84
87
|
query[:recurring] = options[:recurring ] # add_subscription
|
|
85
88
|
query[:plan_id] = options [:plan_id]
|
|
86
|
-
query[:plan_name]
|
|
89
|
+
query[:plan_name] = options [:plan_name]
|
|
87
90
|
query[:plan_payments] = options [:plan_payments] # 0 until canceled
|
|
88
91
|
query[:plan_amount] = options [:plan_amount]
|
|
89
92
|
query[:day_frequency] = options [:day_frequency]
|
|
@@ -2,11 +2,15 @@ module NMIGateway
|
|
|
2
2
|
class CustomerVault < Api
|
|
3
3
|
|
|
4
4
|
# NMIGateway::CustomerVault.new.create ccnumber: '4111111111111111', ccexp: "0219", first_name: "John", last_name: "Doe"
|
|
5
|
+
# NMIGateway::CustomerVault.new.create payment_token: "00000000-000000-000000-000000000000", first_name: "John", last_name: "Doe"
|
|
5
6
|
def create(options = {})
|
|
6
7
|
query = set_query(options)
|
|
7
8
|
query[:customer_vault] = 'add_customer'
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
if query[:payment_token]
|
|
10
|
+
require_fields(:payment_token, :first_name, :last_name)
|
|
11
|
+
else
|
|
12
|
+
require_fields(:ccnumber, :ccexp, :first_name, :last_name)
|
|
13
|
+
end
|
|
10
14
|
post query
|
|
11
15
|
end
|
|
12
16
|
|
data/lib/nmi_gateway/response.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module NMIGateway
|
|
2
2
|
class Response
|
|
3
3
|
|
|
4
|
-
attr_accessor :response, :success, :code, :api_type, :transactions, :customers, :response_text, :response_message, :customer_vault_id, :subscription_id, :plan_id, :plan_amount, :orderid, :transactionid, :authcode, :response_code
|
|
4
|
+
attr_accessor :response, :success, :code, :api_type, :transactions, :customers, :response_text, :response_message, :customer_vault_id, :subscription_id, :plan_id, :plan_amount, :orderid, :transactionid, :authcode, :response_code, :avs_response_code, :cvv_response_code, :response_code_message, :avs_response_code_message, :cvv_response_code_message
|
|
5
5
|
|
|
6
6
|
def initialize(response, api_type)
|
|
7
7
|
@response = response
|
|
@@ -39,6 +39,11 @@ module NMIGateway
|
|
|
39
39
|
@subscription_id = parsed['subscription_id'].first if parsed['subscription_id'].first.present?
|
|
40
40
|
@orderid = parsed['orderid'].first if parsed['orderid'].first.present?
|
|
41
41
|
@transactionid = parsed['transactionid'].first if parsed['transactionid'].first.present?
|
|
42
|
+
@avs_response_code = parsed['avsresponse'].first if parsed['avsresponse']&.first.present?
|
|
43
|
+
@cvv_response_code = parsed['cvvresponse'].first if parsed['cvvresponse']&.first.present?
|
|
44
|
+
@response_code_message = response_codes.dig(response_code) if response_code.present?
|
|
45
|
+
@avs_response_code_message = avs_response_codes.dig(avs_response_code) if avs_response_code.present?
|
|
46
|
+
@cvv_response_code_message = cvv_response_codes.dig(cvv_response_code) if cvv_response_code.present?
|
|
42
47
|
parsed
|
|
43
48
|
end
|
|
44
49
|
else
|
|
@@ -65,7 +65,7 @@ module NMIGateway
|
|
|
65
65
|
post query
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
# NMIGateway::Transaction.new.find
|
|
68
|
+
# NMIGateway::Transaction.new.find transaction_id: 3261844010
|
|
69
69
|
def find(options = {})
|
|
70
70
|
query = set_query(options)
|
|
71
71
|
query[:report_type] ||= 'transaction'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: figpay_gateway
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Eggett
|
|
@@ -217,6 +217,7 @@ files:
|
|
|
217
217
|
- ".env.sample"
|
|
218
218
|
- ".github/workflows/ci.yml"
|
|
219
219
|
- ".gitignore"
|
|
220
|
+
- ".ruby-version"
|
|
220
221
|
- ".tool-versions"
|
|
221
222
|
- Gemfile
|
|
222
223
|
- Guardfile
|