payu_api 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -0
- data/lib/payu_api.rb +2 -0
- data/lib/payu_api/client.rb +4 -0
- data/lib/payu_api/paymethods.rb +10 -0
- data/lib/payu_api/responses/paymethods_response.rb +18 -0
- data/lib/payu_api/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76a58280746739f8fde20c12bc5baa4967714074
|
4
|
+
data.tar.gz: 78e1448b997ea30a5aafcf06fe256bfd47512bf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f70f51bb3f4f69f4191f4e76ffdad131b1aa58a2ffc538aca9ec72237af1fa5d40339bee66e4e4f69f13e581739c132817f084a7c5f7f75a6cbb329768ead7f
|
7
|
+
data.tar.gz: ac7b9111c41c08ba1bdaaf4d6a34d10be87a8e4659c080e26b8073ff6bad803157bd197182b840bb2f7b94110f63faee31a5cbcb6f4338c54e8be104e808eb37
|
data/README.md
CHANGED
@@ -179,6 +179,37 @@ PayuAPI.signature_valid?(
|
|
179
179
|
# => true
|
180
180
|
```
|
181
181
|
|
182
|
+
Retrieve payment methods which are enabled for pos:
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
response = client.get_paymethods
|
186
|
+
|
187
|
+
response.success?
|
188
|
+
# => true
|
189
|
+
|
190
|
+
response.pay_by_links
|
191
|
+
# => [
|
192
|
+
# {
|
193
|
+
# :value=>"m",
|
194
|
+
# :brandImageUrl=>"https://static.payu.com/images/mobile/logos/pbl_m.png",
|
195
|
+
# :name=>"mTransfer",
|
196
|
+
# :status=>"ENABLED"
|
197
|
+
# },
|
198
|
+
# {
|
199
|
+
# :value=>"m",
|
200
|
+
# :brandImageUrl=>"https://static.payu.com/images/mobile/logos/pbl_o.png",
|
201
|
+
# :name=>"Płacę z Bankiem Pekao S.A.",
|
202
|
+
# :status=>"ENABLED"
|
203
|
+
# },
|
204
|
+
# ]
|
205
|
+
```
|
206
|
+
Similarly you can use `response.pex_tokens` to get `pexTokens` and `response.card_tokens` to get `cardTokens`. In case of no results available, the result will be empty array.
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
response.pex_tokens
|
210
|
+
# => []
|
211
|
+
```
|
212
|
+
|
182
213
|
## Contributing
|
183
214
|
|
184
215
|
Bug reports and pull requests are welcome on GitHub at https://github.com/busfor/payu_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/lib/payu_api.rb
CHANGED
@@ -13,8 +13,10 @@ require 'payu_api/responses/auth_response'
|
|
13
13
|
require 'payu_api/responses/get_response'
|
14
14
|
require 'payu_api/responses/create_response'
|
15
15
|
require 'payu_api/responses/refund_response'
|
16
|
+
require 'payu_api/responses/paymethods_response'
|
16
17
|
require 'payu_api/build_signature'
|
17
18
|
require 'payu_api/order'
|
19
|
+
require 'payu_api/paymethods'
|
18
20
|
require 'payu_api/client'
|
19
21
|
|
20
22
|
module PayuAPI
|
data/lib/payu_api/client.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# This methods allows to retrieve paymethods which are enabled for pos.
|
2
|
+
# For merchants with token payments enabled it also retrieves user payments tokens.
|
3
|
+
# Token payments requires OAuth token with grant type trusted_merchant.
|
4
|
+
module PayuAPI
|
5
|
+
class PaymethodsResponse < Response
|
6
|
+
def card_tokens
|
7
|
+
body[:cardTokens] || []
|
8
|
+
end
|
9
|
+
|
10
|
+
def pex_tokens
|
11
|
+
body[:pexTokens] || []
|
12
|
+
end
|
13
|
+
|
14
|
+
def pay_by_links
|
15
|
+
body[:payByLinks] || []
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/payu_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payu_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Khrebtov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-initializer
|
@@ -159,11 +159,13 @@ files:
|
|
159
159
|
- lib/payu_api/client.rb
|
160
160
|
- lib/payu_api/errors.rb
|
161
161
|
- lib/payu_api/order.rb
|
162
|
+
- lib/payu_api/paymethods.rb
|
162
163
|
- lib/payu_api/request.rb
|
163
164
|
- lib/payu_api/response.rb
|
164
165
|
- lib/payu_api/responses/auth_response.rb
|
165
166
|
- lib/payu_api/responses/create_response.rb
|
166
167
|
- lib/payu_api/responses/get_response.rb
|
168
|
+
- lib/payu_api/responses/paymethods_response.rb
|
167
169
|
- lib/payu_api/responses/refund_response.rb
|
168
170
|
- lib/payu_api/version.rb
|
169
171
|
- payu_api.gemspec
|
@@ -187,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
189
|
version: '0'
|
188
190
|
requirements: []
|
189
191
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.4.
|
192
|
+
rubygems_version: 2.4.5.1
|
191
193
|
signing_key:
|
192
194
|
specification_version: 4
|
193
195
|
summary: Ruby wrapper for PayU REST API
|