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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0a09ef25c0277c79ba548c7dea0845e8bcbdc85b98ce4b744f68b38cf3f6a7c
4
- data.tar.gz: 8bc4a5747095180ee934641f4a7519a1770bffa72336b38a5a6c6a5896bb21a1
3
+ metadata.gz: d59cba6b47a82b9e89b53596dfacbab9d878a5d4d9cea9d8203c7b86f16437ad
4
+ data.tar.gz: a1c7b968a83539aff97dd6ca9ecbcb036b7618ade945572ac6221a3c4aaf96ed
5
5
  SHA512:
6
- metadata.gz: 586f04f067969ed8ed10712642c0a35a0cae7db3e312f92a2b1fa492ae8ca06e5ebe2e5b08899ef1251cf32954c28cab75e26d8f07305f4ec381e31086990749
7
- data.tar.gz: dced5d25b7e481f951bb6e29236b5536eb35822c5ba666e1a817b1065f1c8a765bb70cc997e843e1517d654773031319aaa9db982084b1cd007fc9c83508f9f8
6
+ metadata.gz: 38b028203836e1051721ea735c616c331632833cda9eb0f15e15d9b0fa73236db8d433eb1f6715c8c692db56b918b45e3381c5d30f6738d4a214520fb6c1e8f3
7
+ data.tar.gz: cc42df57043042e8daa71c4648d0698af797432390d8f00fb2df31f6fbc39c7ef7ac0355d4ec140ab8bccab6613d2b0f9b95b89dbad5acaf00a34eef3928f538
data/.gitignore CHANGED
@@ -17,7 +17,7 @@ mkmf.log
17
17
 
18
18
  .DS_Store
19
19
  .env
20
- .ruby-version
20
+ # .ruby-version # used in ci.yml
21
21
  .ruby-gemset
22
22
 
23
23
  # Editor tags files
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
- transactionid: '3261844010'
200
+ transaction_id: '3261844010'
190
201
  )
191
202
  ```
192
203
 
@@ -1,3 +1,3 @@
1
1
  module FigpayGateway
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -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] = options [: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
- require_fields(:ccnumber, :ccexp)
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
 
@@ -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 transactionid: 3261844010
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.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