paypoint-blue 0.4.1 → 0.5.0

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
  SHA1:
3
- metadata.gz: 6078c16111c929c837584fee6e2d5011242697c3
4
- data.tar.gz: 86dc6770b39136f5fa3e27dd1a07c0aa1991ab6c
3
+ metadata.gz: 26434c8238928ff5264149ab326cb8abc533b583
4
+ data.tar.gz: 9b31f00f2e93d4a4b2b16e937741d630b5c4d1e3
5
5
  SHA512:
6
- metadata.gz: a39bc9d49936d4bed1a21fc36dd4cb5246a8cdea160e9d9bfc2c97542f8805d0617bd9b991e7878d708755067fd3666830dd0fd7d7c6095af76631405df6aff2
7
- data.tar.gz: bf1cc6dfe2c41012d6d50d24d5dabbcce6d76cf2a7b400610d0ec63f455690fe4cad4a999ba0715454f14416590dc8256d9bcb3fc1987a9890593a4221a70e7d
6
+ metadata.gz: 79b82933e3223172365031a9ab577bf150cf87fb5de0f4df34dd980e98b447e2c9c3f8d78c79e39a61e1b4bcf08f0221d03aa673a7d2db0dac21c0435e7d8ec4
7
+ data.tar.gz: ed506267c32222a54022814f341e9b2c0ea103ac8e5d2b6e415064c528df25345eef838a54645101f9213a86bf2213a012121eb3b6db8a88ac04b32080c62bae
data/bin/console CHANGED
@@ -112,7 +112,7 @@ def callbacks
112
112
  end
113
113
 
114
114
  def card(type: :mc_debit, valid: true, threeDS: true)
115
- {
115
+ { type: type, valid: valid, threeDS: threeDS }.merge pan: {
116
116
  mc_debit: {
117
117
  true => {
118
118
  true => "9900000000005159",
@@ -183,4 +183,49 @@ class PayPoint::Blue::API < PayPoint::Blue::Base
183
183
  )
184
184
  client.post "transactions/#{inst_id}/payout", payload
185
185
  end
186
+
187
+ # Get details of a customer
188
+ #
189
+ # @api_url https://developer.paypoint.com/payments/docs/#customers/request_customer_and_cards
190
+ #
191
+ # @param [String] customer_id the id of the customer as assigned by PayPoint
192
+ #
193
+ # @return the API response
194
+ def customer(customer_id)
195
+ client.get "customers/#{inst_id}/#{customer_id}"
196
+ end
197
+
198
+ # Get details of a customer by merchant reference
199
+ #
200
+ # @api_url https://developer.paypoint.com/payments/docs/#customers/request_customer_and_cards
201
+ #
202
+ # @param [String] customer_ref the merchant reference for the customer
203
+ #
204
+ # @return the API response
205
+ def customer_by_ref(customer_ref)
206
+ client.get "customers/#{inst_id}/byRef?merchantRef=#{customer_ref}"
207
+ end
208
+
209
+ # Get the list of the registered payment methods of a customer
210
+ #
211
+ # @api_url https://developer.paypoint.com/payments/docs/#customers/request_customer_and_cards
212
+ #
213
+ # @param [String] customer_id the id of the customer as assigned by PayPoint
214
+ #
215
+ # @return the API response
216
+ def customer_payment_methods(customer_id)
217
+ client.get "customers/#{inst_id}/#{customer_id}/paymentMethods"
218
+ end
219
+
220
+ # Get a specific registered payment method of a customer
221
+ #
222
+ # @api_url https://developer.paypoint.com/payments/docs/#customers/request_customer_and_cards
223
+ #
224
+ # @param [String] customer_id the id of the customer as assigned by PayPoint
225
+ # @param [String] token the token identifying the payment method
226
+ #
227
+ # @return the API response
228
+ def customer_payment_method(customer_id, token)
229
+ client.get "customers/#{inst_id}/#{customer_id}/paymentMethods/#{token}"
230
+ end
186
231
  end
@@ -32,7 +32,11 @@ class PayPoint::Blue::Hosted < PayPoint::Blue::Base
32
32
  :cancel_authorisation,
33
33
  :transaction,
34
34
  :transactions_by_ref,
35
- :refund_payment
35
+ :refund_payment,
36
+ :customer,
37
+ :customer_by_ref,
38
+ :customer_payment_methods,
39
+ :customer_payment_method
36
40
 
37
41
  # The Hosted product has only a few endpoints. However, users most
38
42
  # likey will want to access the endpoints of the API product as well.
@@ -111,4 +115,19 @@ class PayPoint::Blue::Hosted < PayPoint::Blue::Base
111
115
  )
112
116
  client.post "sessions/#{inst_id}/payouts", build_payload(payload)
113
117
  end
118
+
119
+ # Manage Cards
120
+ #
121
+ # @api_url https://developer.paypoint.com/payments/docs/#customers/update_customer_cards
122
+ #
123
+ # @applies_defaults +:skin+
124
+ #
125
+ # @param [Hash] payload the payload is made up of the keyword
126
+ # arguments passed to the method
127
+ #
128
+ # @return the API response
129
+ def manage_cards(**payload)
130
+ payload = build_payload payload, defaults: %i(skin)
131
+ client.post "sessions/#{inst_id}/cards", build_payload(payload)
132
+ end
114
133
  end
@@ -1,5 +1,5 @@
1
1
  module PayPoint
2
2
  module Blue # rubocop:disable Documentation
3
- VERSION = "0.4.1"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypoint-blue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laszlo Bacsi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -208,3 +208,4 @@ signing_key:
208
208
  specification_version: 4
209
209
  summary: API client for PayPoint Blue
210
210
  test_files: []
211
+ has_rdoc: