paddle_pay 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: 3e75fd1711d3133981098f8379f87a85b532156ce231b6f01f96c455c2040a92
4
- data.tar.gz: ea8f0882868c9f9cd33ffbacf3791132eeec8d8fe817810ffe8640fb34049cce
3
+ metadata.gz: d2851706b1aa5000cc4eb332165a5587824ac66196e91daa7ce5b46ab2edd431
4
+ data.tar.gz: 646130416e4f747589df3e6d5d3abe550947396b6df71393d0b05c76adc1f897
5
5
  SHA512:
6
- metadata.gz: e6bbbeb8253f29370f9cea2f6a9f1174941d150d000139dc3fb42149e05fe4c0e6858e78fa16275532681a6782e58039f18366cced32a310552e5eb7d33c441a
7
- data.tar.gz: 3c9e27d97af64a9b3d1e8a1af4572e527bf465b19ec92efc8a377b6f0d9fe95359cbb625c158948e6a4b15b70d0272c289ca9a1b06e29fb2c010a98923ecab9c
6
+ metadata.gz: acdd0b25613b63faab14304ca2587d0b8cc049b285d6ed7dfd1facb10eddba1d68f284ff94c28d11e81e67e9328d88014365f7d5443035cb5779ddbe94a9b9ba
7
+ data.tar.gz: 460eff4f950b8206bf9d96bd5d32737296cc8e33265e92e0be3ee76c57f534a5746a2b3292a721e161ddb25287e4e904494597e3eb7089f8fb476e8e5e2fd823
data/README.md CHANGED
@@ -213,6 +213,16 @@ id = '123456'
213
213
  PaddlePay::Transaction::User.list(id, options = {})
214
214
  ```
215
215
 
216
+ ## Proxy
217
+
218
+ ```ruby
219
+ PaddlePay.configure do |config|
220
+ config.proxy_host = 'YOUR PROXY HOST'
221
+ config.proxy_port = 'YOUR PROXY PORT'
222
+ config.ssl_verify = true
223
+ end
224
+ ```
225
+
216
226
  ## Webhooks
217
227
 
218
228
  With this gem it is possible to communicate with the Paddle API, but no webhooks are handled. If you want to handle Paddle webhooks in a Ruby on Rails application, please have a look at the [pay gem](https://github.com/pay-rails/pay) where this gem is integrated.
@@ -3,6 +3,9 @@
3
3
  module PaddlePay
4
4
  class Configuration
5
5
  attr_reader :environment
6
+ attr_accessor :proxy_host
7
+ attr_accessor :proxy_port
8
+ attr_accessor :ssl_verify
6
9
  attr_accessor :vendor_auth_code
7
10
  attr_accessor :vendor_id
8
11
 
@@ -9,7 +9,9 @@ module PaddlePay
9
9
  headers = options.delete(:headers) || {}
10
10
  body = options.delete(:body) || {}
11
11
 
12
- conn = Faraday.new(url: request_url) { |faraday|
12
+ conn = Faraday.new(url: request_url,
13
+ proxy: proxy_url,
14
+ ssl: {verify: PaddlePay.config.ssl_verify}) { |faraday|
13
15
  faraday.request :url_encoded
14
16
  faraday.response :raise_error
15
17
  faraday.response :json
@@ -62,6 +64,14 @@ module PaddlePay
62
64
  vendor_auth_code: PaddlePay.config.vendor_auth_code
63
65
  }
64
66
  end
67
+
68
+ def proxy_url
69
+ if PaddlePay.config.proxy_host && PaddlePay.config.proxy_port
70
+ return "#{PaddlePay.config.proxy_host}:#{PaddlePay.config.proxy_port}"
71
+ end
72
+
73
+ nil
74
+ end
65
75
  end
66
76
  end
67
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaddlePay
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paddle_pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Metzger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  - !ruby/object:Gem::Version
282
282
  version: '0'
283
283
  requirements: []
284
- rubygems_version: 3.2.32
284
+ rubygems_version: 3.2.33
285
285
  signing_key:
286
286
  specification_version: 4
287
287
  summary: A Ruby wrapper for the paddle.com API