paypoint-blue 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +1 -1
- data/lib/paypoint/blue/api.rb +45 -0
- data/lib/paypoint/blue/hosted.rb +20 -1
- data/lib/paypoint/blue/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26434c8238928ff5264149ab326cb8abc533b583
|
4
|
+
data.tar.gz: 9b31f00f2e93d4a4b2b16e937741d630b5c4d1e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79b82933e3223172365031a9ab577bf150cf87fb5de0f4df34dd980e98b447e2c9c3f8d78c79e39a61e1b4bcf08f0221d03aa673a7d2db0dac21c0435e7d8ec4
|
7
|
+
data.tar.gz: ed506267c32222a54022814f341e9b2c0ea103ac8e5d2b6e415064c528df25345eef838a54645101f9213a86bf2213a012121eb3b6db8a88ac04b32080c62bae
|
data/bin/console
CHANGED
data/lib/paypoint/blue/api.rb
CHANGED
@@ -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
|
data/lib/paypoint/blue/hosted.rb
CHANGED
@@ -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
|
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
|
+
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-
|
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:
|