paddlerb 0.1.1 → 0.1.4

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: d29bab2cc198f4a6f157226dc74aecd5004253267126616c2f474b2e900377ca
4
- data.tar.gz: 610847cc06d3bc542c33d8417b9c32721adee4b89a13afd1e78c376ada42212b
3
+ metadata.gz: a3345bfa15fce5cb913aed28b11b063e63762cb1642e845b14ea460ba17dde0a
4
+ data.tar.gz: b3d0805971f5fb4333e16be6f7a1cfa8ca6eb756c4b51e8eaf85bd295b080839
5
5
  SHA512:
6
- metadata.gz: 188e53b50fe7ecb07f9d2cca75a44f1b3532ff5c4577f13ce29b12582ef083cc40442398a8d918b7fd3be73d7034feec26138a60c94a8d58a15f1536abb2d016
7
- data.tar.gz: a20504bc60b6e43986e7502685eb8568b7d9858e8bbb4dcfdb862246b92b3d5e6f6241b9c1e0575d15ee182a7957c5657f812a08c11054c4a19b68d5455face7
6
+ metadata.gz: d19691761339e8b0b19927fc16bc3028466b7cadd15307915892c904cf2fd72b15f08f7e4d31717ef0932444665fc64a074e42be04b1b7d4abe87a3a542dc8bd
7
+ data.tar.gz: 998be2a5fa670889a71849bf1accd1f8e7d0bebab0553ad5e9a31b4373b95527312eb43419e6387b7c9c729f9de17928fd68b034c6ba889c8b88e82cb229ffca
data/Gemfile.lock CHANGED
@@ -1,41 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paddlerb (0.1.1)
5
- faraday (~> 1.7)
6
- faraday_middleware (~> 1.1)
4
+ paddlerb (0.1.4)
5
+ faraday (~> 2.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
10
  dotenv (2.7.6)
12
- faraday (1.9.3)
13
- faraday-em_http (~> 1.0)
14
- faraday-em_synchrony (~> 1.0)
15
- faraday-excon (~> 1.1)
16
- faraday-httpclient (~> 1.0)
17
- faraday-multipart (~> 1.0)
18
- faraday-net_http (~> 1.0)
19
- faraday-net_http_persistent (~> 1.0)
20
- faraday-patron (~> 1.0)
21
- faraday-rack (~> 1.0)
22
- faraday-retry (~> 1.0)
11
+ faraday (2.2.0)
12
+ faraday-net_http (~> 2.0)
23
13
  ruby2_keywords (>= 0.0.4)
24
- faraday-em_http (1.0.0)
25
- faraday-em_synchrony (1.0.0)
26
- faraday-excon (1.1.0)
27
- faraday-httpclient (1.0.1)
28
- faraday-multipart (1.0.3)
29
- multipart-post (>= 1.2, < 3)
30
- faraday-net_http (1.0.1)
31
- faraday-net_http_persistent (1.2.0)
32
- faraday-patron (1.0.0)
33
- faraday-rack (1.0.0)
34
- faraday-retry (1.0.3)
35
- faraday_middleware (1.2.0)
36
- faraday (~> 1.0)
37
- minitest (5.14.4)
38
- multipart-post (2.1.1)
14
+ faraday-net_http (2.0.2)
15
+ minitest (5.15.0)
39
16
  rake (13.0.6)
40
17
  ruby2_keywords (0.0.5)
41
18
 
@@ -49,4 +26,4 @@ DEPENDENCIES
49
26
  rake (~> 13.0)
50
27
 
51
28
  BUNDLED WITH
52
- 2.3.5
29
+ 2.3.6
data/lib/paddle/client.rb CHANGED
@@ -64,7 +64,6 @@ module Paddle
64
64
  @connection ||= Faraday.new(url) do |conn|
65
65
  conn.request :json
66
66
 
67
- conn.response :dates
68
67
  conn.response :json, content_type: "application/json"
69
68
 
70
69
  conn.adapter adapter, @stubs
@@ -12,6 +12,18 @@ module Paddle
12
12
  User.new(response.body["response"]) if response.success?
13
13
  end
14
14
 
15
+ def pause(subscription_id:, **params)
16
+ attrs = {subscription_id: subscription_id, pause: true}
17
+ response = post_request("2.0/subscription/users/update", body: attrs.merge(params))
18
+ User.new(response.body["response"]) if response.success?
19
+ end
20
+
21
+ def unpause(subscription_id:, **params)
22
+ attrs = {subscription_id: subscription_id, pause: false}
23
+ response = post_request("2.0/subscription/users/update", body: attrs.merge(params))
24
+ User.new(response.body["response"]) if response.success?
25
+ end
26
+
15
27
  def update_postcode(subscription_id:, postcode:)
16
28
  attrs = {subscription_id: subscription_id, postcode: postcode}
17
29
  response = post_request("2.0/subscription/users/postcode", body: attrs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paddle
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/paddle.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "faraday"
4
- require "faraday_middleware"
5
4
 
6
5
  require_relative "paddle/version"
7
6
 
data/paddlerb.gemspec CHANGED
@@ -28,6 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency "faraday", "~> 1.7"
32
- spec.add_dependency "faraday_middleware", "~> 1.1"
31
+ spec.add_dependency "faraday", "~> 2.0"
33
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paddlerb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,28 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
27
- - !ruby/object:Gem::Dependency
28
- name: faraday_middleware
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.1'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.1'
26
+ version: '2.0'
41
27
  description:
42
28
  email:
43
29
  - dean@deanpcmad.com
@@ -104,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
90
  - !ruby/object:Gem::Version
105
91
  version: '0'
106
92
  requirements: []
107
- rubygems_version: 3.2.22
93
+ rubygems_version: 3.1.6
108
94
  signing_key:
109
95
  specification_version: 4
110
96
  summary: Ruby library for interacting with the Paddle API