afterpay 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c0546dacab8904577cf4598e6d6df51252708a23c2a1aaff7d60c1f89ae9fe4
|
4
|
+
data.tar.gz: d669f542377a1f1690375dc1721183eb96cc1fa911ccdb7534ca1f71ec416a01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6ba4ea7c953533d03ffd0850d672be93076614d6b85c9d73beefe78a61688ce2bdedf064e300daad9d44126162090dbe69c86fd95e7fb5f473dab522d78a3e3
|
7
|
+
data.tar.gz: 9987f7c53e07053a090c221b68a4329c58944d0a0fc135b1b4012ad6a12593395a1d7326f9cd35e14e66a0b2cc45e8d9f257264122cbf86bf88a9cf65bcfa3cb
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Afterpay
|
4
|
+
module API
|
5
|
+
module Payment
|
6
|
+
class Reversal < Base
|
7
|
+
def initialize(params = {})
|
8
|
+
@token = params[:token]
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
attr_reader :token
|
14
|
+
|
15
|
+
def payload
|
16
|
+
{
|
17
|
+
action: :post,
|
18
|
+
endpoint: endpoint
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
def endpoint
|
23
|
+
"#{URL}/token:#{token}/reversal"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -43,6 +43,11 @@ module Afterpay
|
|
43
43
|
# @return [String]
|
44
44
|
# The estimated date when the order will be shipped, in YYYY-MM or YYYY-MM-DD format
|
45
45
|
attr_accessor :estimated_shipment_date
|
46
|
+
|
47
|
+
# @attribute preorder
|
48
|
+
# @return boolean
|
49
|
+
# Should return false when the estimated_shipment_date is already passed otherwise true
|
50
|
+
attr_accessor :preorder
|
46
51
|
end
|
47
52
|
end
|
48
53
|
end
|
@@ -37,9 +37,11 @@ module Afterpay
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def faraday_options
|
40
|
-
|
40
|
+
{ "headers" => headers }
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
+
def headers
|
44
|
+
{ 'Content-Type' => 'application/json', 'User-Agent' => ::Afterpay.user_agent }.compact
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
data/lib/afterpay/version.rb
CHANGED
data/lib/afterpay.rb
CHANGED
@@ -13,6 +13,7 @@ require 'afterpay/api/payment/auth'
|
|
13
13
|
require 'afterpay/api/payment/void'
|
14
14
|
require 'afterpay/api/payment/deferred_capture'
|
15
15
|
require 'afterpay/api/payment/find'
|
16
|
+
require 'afterpay/api/payment/reversal'
|
16
17
|
require 'afterpay/components/base'
|
17
18
|
require 'afterpay/components/consumer'
|
18
19
|
require 'afterpay/components/contact'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: afterpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Vygovsky
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-10-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -246,6 +246,7 @@ files:
|
|
246
246
|
- lib/afterpay/api/payment/deferred_capture.rb
|
247
247
|
- lib/afterpay/api/payment/find.rb
|
248
248
|
- lib/afterpay/api/payment/refund.rb
|
249
|
+
- lib/afterpay/api/payment/reversal.rb
|
249
250
|
- lib/afterpay/api/payment/void.rb
|
250
251
|
- lib/afterpay/callable.rb
|
251
252
|
- lib/afterpay/components/base.rb
|