wayforpay 0.1.5 → 0.1.6

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: 79b84cca8666a23a081ec417499bf3bd404fd171
4
- data.tar.gz: 792553879e96ceb677d8fc8290456c941e597d30
3
+ metadata.gz: f24c633565d1c4873732938ded1874667455334f
4
+ data.tar.gz: ff6880d180f9859ae5644fc26c38d527b31b6779
5
5
  SHA512:
6
- metadata.gz: c3954623a31b41cc4c977f354de8e39f052240368d9730c54c33f6e9e2936cf11affe96b28f9c616aa27a9a095b30aac699b84f38f2ecdba1f80e9de66dd9451
7
- data.tar.gz: 32a0429b7572a96e93a832d382895d4bb6429a63763c6046e4d472dd750c3f60da26ba98deeebb55e832fa4c7552774e3f7699e3836c25f8d0cd06c716d9dd6f
6
+ metadata.gz: 94a719b0ef5ae4cea85bf00702602f5bc834f6ffc85fca49ba28144e8d18f5f3757b0095596ce145a87239f4c21001991c38b768362f89c731c97f3354a8d5d3
7
+ data.tar.gz: eae8032a449530661f8bf4694513ec9075a80ef29ebca0609a0813242e68482bdb245d451ed3cdf0bd00adb7f3cf5860720847fc5a81a6346e367cd33ab7cc79
data/README.md CHANGED
@@ -171,6 +171,29 @@
171
171
  "invoiceUrl": "https://secure.wayforpay.com/invoice/i99edb6518fb5"
172
172
  }
173
173
  ```
174
+
175
+ ### Acceptance of invoice payments. ([Invoice](https://wiki.wayforpay.com/display/WADE/Invoice), scroll down)
176
+
177
+ ```ruby
178
+ Wayforpay::Payments.accept_invoice_payment(parameters)
179
+ ```
180
+
181
+ Required parameters:
182
+
183
+ | Parameter | Description |
184
+ | ----------------- | ------------------------------------------------------ |
185
+ | orderReference | Unique number of the order in merchant’s system |
186
+ | time | Time of acceptance |
187
+
188
+ An example of request:
189
+
190
+ ```ruby
191
+ {
192
+ "orderReference": "myOrder1",
193
+ "time": 1421412898
194
+ }
195
+ ```
196
+
174
197
  ## Contributing
175
198
 
176
199
  1. Fork it
@@ -9,6 +9,7 @@ module Wayforpay
9
9
  SETTLE_ENCRYPT_FIELDS = %i[merchantAccount orderReference amount currency].freeze
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
+ ACCEPT_INVOICE_PAYMENT_ENCRYPT_FIELDS = %i[orderReference status time].freeze
12
13
 
13
14
  HOLD_ATTRS = {
14
15
  transactionType: 'CHARGE',
@@ -41,6 +42,10 @@ module Wayforpay
41
42
  apiVersion: 1
42
43
  }.freeze
43
44
 
45
+ ACCEPT_INVOICE_PAYMENT_ATTRS = {
46
+ status:'accept'
47
+ }.freeze
48
+
44
49
  def self.hold_params
45
50
  HOLD_ATTRS.merge(
46
51
  merchantAccount: Wayforpay.merchant_account,
@@ -69,5 +74,9 @@ module Wayforpay
69
74
  merchantDomainName: Wayforpay.merchant_domain_name
70
75
  )
71
76
  end
77
+
78
+ def self.accept_invoice_payment_params
79
+ ACCEPT_INVOICE_PAYMENT_ATTRS
80
+ end
72
81
  end
73
82
  end
@@ -32,5 +32,11 @@ module Wayforpay
32
32
  request_params = Constants.create_invoice_params.merge(attrs)
33
33
  Wayforpay::Request.(Constants::CREATE_INVOICE_ENCRYPT_FIELDS, request_params)
34
34
  end
35
+
36
+ # required attrs: orderReference, status, time
37
+ def self.accept_invoice_payment(attrs = {})
38
+ request_params = Constants.accept_invoice_payment_params.merge(attrs)
39
+ Wayforpay::Request.(Constants::ACCEPT_INVOICE_PAYMENT_ENCRYPT_FIELDS, request_params)
40
+ end
35
41
  end
36
42
  end
@@ -1,3 +1,3 @@
1
1
  module Wayforpay
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
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.5
4
+ version: 0.1.6
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-23 00:00:00.000000000 Z
12
+ date: 2020-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler