wayforpay 0.1.6 → 0.1.7
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/README.md +29 -0
- data/lib/wayforpay/constants.rb +10 -0
- data/lib/wayforpay/payments.rb +6 -0
- data/lib/wayforpay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bad194f2649f2f629177acf36ac434f5f0623214
|
4
|
+
data.tar.gz: d376a80b0d1d3805dd980afe7835173178c3edb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eca4f08b2cd7086d3f7d20f85c39e9835bee8750698d2049b1e0cbd185b289a47040c9353d6bb4ca15a9ef842c0e6825a7a4953d909e4b7513c8376d9f23afe
|
7
|
+
data.tar.gz: c484cbb60a070037382c29bbc1be9dcf7e9b5b5c66feb97a588ef3aede0f70af85e48ca372e0ed20975b0fe5c152e3a08bf8951d689e461ed0cb69404ebaa0ce
|
data/README.md
CHANGED
@@ -194,6 +194,35 @@
|
|
194
194
|
}
|
195
195
|
```
|
196
196
|
|
197
|
+
### Receiving client data. ([Get Client](https://wiki.wayforpay.com/pages/viewpage.action?pageId=2424999))
|
198
|
+
|
199
|
+
```ruby
|
200
|
+
Wayforpay::Payments.get_client(parameters)
|
201
|
+
```
|
202
|
+
|
203
|
+
Required parameters: one of card or recToken !
|
204
|
+
|
205
|
+
| Parameter | Description |
|
206
|
+
| ----------------- | ------------------------------------------------------ |
|
207
|
+
| *card* | Card number 16 characters |
|
208
|
+
| *recToken* | Card token |
|
209
|
+
|
210
|
+
***Note: field card or recToken should be required.***
|
211
|
+
|
212
|
+
An example of request:
|
213
|
+
|
214
|
+
```ruby
|
215
|
+
{
|
216
|
+
"card": "4111111111111111"
|
217
|
+
}
|
218
|
+
```
|
219
|
+
|
220
|
+
```ruby
|
221
|
+
{
|
222
|
+
"recToken": "55111111-1111-0000-9988-68c457123456"
|
223
|
+
}
|
224
|
+
```
|
225
|
+
|
197
226
|
## Contributing
|
198
227
|
|
199
228
|
1. Fork it
|
data/lib/wayforpay/constants.rb
CHANGED
@@ -10,6 +10,7 @@ module Wayforpay
|
|
10
10
|
VERIFY_ENCRYPT_FIELDS = %i[merchantAccount merchantDomainName orderReference amount currency].freeze
|
11
11
|
CREATE_INVOICE_ENCRYPT_FIELDS = %i[merchantAccount merchantDomainName orderReference orderDate amount currency productName productCount productPrice].freeze
|
12
12
|
ACCEPT_INVOICE_PAYMENT_ENCRYPT_FIELDS = %i[orderReference status time].freeze
|
13
|
+
GET_CLIENT_ENCRYPT_FIELDS = %i[merchantAccount recToken card].freeze
|
13
14
|
|
14
15
|
HOLD_ATTRS = {
|
15
16
|
transactionType: 'CHARGE',
|
@@ -46,6 +47,11 @@ module Wayforpay
|
|
46
47
|
status:'accept'
|
47
48
|
}.freeze
|
48
49
|
|
50
|
+
GET_CLIENT_ATTRS = {
|
51
|
+
transactionType: 'GET_CLIENT',
|
52
|
+
apiVersion: 1
|
53
|
+
}
|
54
|
+
|
49
55
|
def self.hold_params
|
50
56
|
HOLD_ATTRS.merge(
|
51
57
|
merchantAccount: Wayforpay.merchant_account,
|
@@ -78,5 +84,9 @@ module Wayforpay
|
|
78
84
|
def self.accept_invoice_payment_params
|
79
85
|
ACCEPT_INVOICE_PAYMENT_ATTRS
|
80
86
|
end
|
87
|
+
|
88
|
+
def self.get_client_params
|
89
|
+
GET_CLIENT_ATTRS.merge(merchantAccount: Wayforpay.merchant_account)
|
90
|
+
end
|
81
91
|
end
|
82
92
|
end
|
data/lib/wayforpay/payments.rb
CHANGED
@@ -38,5 +38,11 @@ module Wayforpay
|
|
38
38
|
request_params = Constants.accept_invoice_payment_params.merge(attrs)
|
39
39
|
Wayforpay::Request.(Constants::ACCEPT_INVOICE_PAYMENT_ENCRYPT_FIELDS, request_params)
|
40
40
|
end
|
41
|
+
|
42
|
+
# required attrs: recToken or card
|
43
|
+
def self.get_client(attrs = {})
|
44
|
+
request_params = Constants.get_client_params.merge(attrs)
|
45
|
+
Wayforpay::Request.(Constants::GET_CLIENT_ENCRYPT_FIELDS, request_params)
|
46
|
+
end
|
41
47
|
end
|
42
48
|
end
|
data/lib/wayforpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wayforpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serhii Savenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-04
|
12
|
+
date: 2020-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|