paysafe 0.14.0 → 0.15.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: aacbcf63a5572fd1a11b9c453cad38fdd3e4b59ac2ecc9108ea658ba0900cc88
4
- data.tar.gz: bd24d67aa5287677b587dc542e05be536699c81331a3b9ba454cfe8b47723657
3
+ metadata.gz: d1bbfde0dd2895a82c9adc48a6f6c9d6042d0df1bc0c66178757b6294d0ac7b2
4
+ data.tar.gz: dbcfa29e11a150101372cd477958e0bb0f5cbada85634de107f924493324123f
5
5
  SHA512:
6
- metadata.gz: 9b01adaf15f3be353afd3b56146c17649f9e696057f328530c585e3ee98e897722708e7082668127979d5a47e1ac28a039c519b22b6d39a52790cb8c947a7b4f
7
- data.tar.gz: 88ee0cbc687f66dd4eb109febf8c881c775c11e174c3440a076cf137ef27ff5d0c7ae2880f7e3e11b6cefe86311edbceca08eacda9a9b0f9179c66d94ac4a685
6
+ metadata.gz: f6252b51e47585cd89fc225c3af1a5b943ef3c1989ab64ef9e093f973fe988129db2b46d2c64bfe45ae0dfdee068e58fbc93d5a99007c513322d47d80e56fba7
7
+ data.tar.gz: 37f20a7402ed60e2b51757c55326b275e4103962cfa44b58ae0e6400a598f552d7955966fe4e954a8e0a38c3e129877c499e70f2b21696a67234fe9d25c49f38
data/.env.sample CHANGED
@@ -2,14 +2,15 @@ PAYSAFE_ACCOUNT_NUMBER="YOUR_ACCOUNT_NUMBER"
2
2
  PAYSAFE_API_KEY="YOUR_API_KEY"
3
3
  PAYSAFE_API_SECRET="YOUR_API_SECRET"
4
4
 
5
- # This is only needed if you want to generate your own Single
6
- # Use Tokens which utilize a different API key and secret.
5
+ # Optional. For generating your own Single Use Tokens.
7
6
  PAYSAFE_SUT_API_KEY="YOUR_SUT_API_KEY"
8
7
  PAYSAFE_SUT_API_SECRET="YOUR_SUT_API_SECRET"
9
8
 
10
- # These are for the Paysafe Payments API which are part of
11
- # what Paysafe refers to as the Unity platform.
9
+ # For the Paysafe "Payments API" (aka Unity platform). This will
10
+ # very likely be the same values as the first set at the top.
12
11
  PAYSAFE_UNITY_API_KEY="YOUR_UNITY_API_KEY"
13
12
  PAYSAFE_UNITY_API_SECRET="YOUR_UNITY_API_SECRET"
13
+
14
+ # Optional. Nothing is using this out of the box.
14
15
  PAYSAFE_UNITY_SUT_API_KEY="YOUR_UNITY_SUT_API_KEY"
15
16
  PAYSAFE_UNITY_SUT_API_SECRET="YOUR_UNITY_SUT_API_SECRET"
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "08:30"
8
+ timezone: America/New_York
9
+ open-pull-requests-limit: 99
10
+ - package-ecosystem: github-actions
11
+ directory: "/"
12
+ schedule:
13
+ interval: daily
14
+ time: "08:30"
15
+ timezone: America/New_York
16
+ open-pull-requests-limit: 99
@@ -11,24 +11,34 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby: [ '2.5', '2.6', '2.7', '3.0' ]
14
+ ruby: [ '3.0', '3.1', '3.2' ]
15
+ env:
16
+ CODECOV_UPLOAD_TAG: ${{ matrix.ruby }}
15
17
  name: Ruby ${{ matrix.ruby }}
16
18
  steps:
17
- - uses: actions/checkout@v2
18
- - uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: ${{ matrix.ruby }}
21
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
22
- - name: Run Tests
23
- env:
24
- PAYSAFE_ACCOUNT_NUMBER: test
25
- PAYSAFE_API_KEY: test
26
- PAYSAFE_API_SECRET: test
27
- PAYSAFE_SUT_API_KEY: test
28
- PAYSAFE_SUT_API_SECRET: test
29
- PAYSAFE_UNITY_API_KEY: test
30
- PAYSAFE_UNITY_API_SECRET: test
31
- PAYSAFE_UNITY_SUT_API_KEY: test
32
- PAYSAFE_UNITY_SUT_API_SECRET: test
33
- run: |
34
- bundle exec rake
19
+ - uses: actions/checkout@v3
20
+ - uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
24
+ - name: Run Tests
25
+ env:
26
+ COVERAGE: true
27
+ RUBYOPT: "-W:deprecated"
28
+ PAYSAFE_ACCOUNT_NUMBER: test
29
+ PAYSAFE_API_KEY: test
30
+ PAYSAFE_API_SECRET: test
31
+ PAYSAFE_SUT_API_KEY: test
32
+ PAYSAFE_SUT_API_SECRET: test
33
+ PAYSAFE_UNITY_API_KEY: test
34
+ PAYSAFE_UNITY_API_SECRET: test
35
+ PAYSAFE_UNITY_SUT_API_KEY: test
36
+ PAYSAFE_UNITY_SUT_API_SECRET: test
37
+ run: |
38
+ bundle exec rake
39
+ - name: Upload coverage to Codecov
40
+ uses: codecov/codecov-action@v3
41
+ with:
42
+ env_vars: CODECOV_UPLOAD_TAG
43
+ fail_ci_if_error: true
44
+ token: ${{ secrets.CODECOV_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## 0.15.0 (2023-07-20)
5
+
6
+ * Updated the `create_single_use_customer_token` method to account for more fields in the response object.
7
+
4
8
  ## 0.14.0 (2021-01-19)
5
9
 
6
10
  * No code changes - moved repository to Jackpocket organization and updated URLs
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
+
3
+ group :test do
4
+ gem "simplecov", require: false
5
+ gem "simplecov-cobertura"
6
+ end
2
7
 
3
8
  # Specify your gem's dependencies in paysafe.gemspec
4
9
  gemspec
data/Gemfile.lock CHANGED
@@ -1,53 +1,64 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paysafe (0.14.0)
5
- http (>= 4, < 5)
4
+ paysafe (0.15.0)
5
+ http (>= 4, < 6)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
11
- public_suffix (>= 2.0.2, < 5.0)
10
+ addressable (2.8.4)
11
+ public_suffix (>= 2.0.2, < 6.0)
12
12
  ansi (1.5.0)
13
13
  builder (3.2.4)
14
14
  crack (0.4.5)
15
15
  rexml
16
+ docile (1.4.0)
16
17
  domain_name (0.5.20190701)
17
18
  unf (>= 0.0.5, < 1.0.0)
18
- dotenv (2.7.6)
19
- ffi (1.14.2)
19
+ dotenv (2.8.1)
20
+ ffi (1.15.5)
20
21
  ffi-compiler (1.0.1)
21
22
  ffi (>= 1.0.0)
22
23
  rake
23
24
  hashdiff (1.0.1)
24
- http (4.4.1)
25
- addressable (~> 2.3)
25
+ http (5.1.1)
26
+ addressable (~> 2.8)
26
27
  http-cookie (~> 1.0)
27
28
  http-form_data (~> 2.2)
28
- http-parser (~> 1.2.0)
29
- http-cookie (1.0.3)
29
+ llhttp-ffi (~> 0.4.0)
30
+ http-cookie (1.0.5)
30
31
  domain_name (~> 0.5)
31
32
  http-form_data (2.3.0)
32
- http-parser (1.2.3)
33
- ffi-compiler (>= 1.0, < 2.0)
34
- minitest (5.14.3)
35
- minitest-mock_expectations (1.1.3)
36
- minitest-reporters (1.4.2)
33
+ llhttp-ffi (0.4.0)
34
+ ffi-compiler (~> 1.0)
35
+ rake (~> 13.0)
36
+ minitest (5.18.1)
37
+ minitest-mock_expectations (1.2.0)
38
+ minitest-reporters (1.6.0)
37
39
  ansi
38
40
  builder
39
41
  minitest (>= 5.0)
40
42
  ruby-progressbar
41
- public_suffix (4.0.6)
42
- rake (13.0.3)
43
- rexml (3.2.4)
44
- ruby-progressbar (1.11.0)
43
+ public_suffix (5.0.3)
44
+ rake (13.0.6)
45
+ rexml (3.2.5)
46
+ ruby-progressbar (1.13.0)
47
+ simplecov (0.22.0)
48
+ docile (~> 1.1)
49
+ simplecov-html (~> 0.11)
50
+ simplecov_json_formatter (~> 0.1)
51
+ simplecov-cobertura (2.1.0)
52
+ rexml
53
+ simplecov (~> 0.19)
54
+ simplecov-html (0.12.3)
55
+ simplecov_json_formatter (0.1.4)
45
56
  unf (0.1.4)
46
57
  unf_ext
47
- unf_ext (0.0.7.7)
48
- vcr (6.0.0)
49
- webmock (3.11.1)
50
- addressable (>= 2.3.6)
58
+ unf_ext (0.0.8.2)
59
+ vcr (6.2.0)
60
+ webmock (3.18.1)
61
+ addressable (>= 2.8.0)
51
62
  crack (>= 0.3.2)
52
63
  hashdiff (>= 0.4.0, < 2.0.0)
53
64
 
@@ -62,8 +73,10 @@ DEPENDENCIES
62
73
  minitest-reporters
63
74
  paysafe!
64
75
  rake
76
+ simplecov
77
+ simplecov-cobertura
65
78
  vcr
66
79
  webmock
67
80
 
68
81
  BUNDLED WITH
69
- 2.1.4
82
+ 2.3.10
data/codecov.yml ADDED
@@ -0,0 +1,5 @@
1
+ coverage:
2
+ status:
3
+ project:
4
+ default:
5
+ threshold: 0.05%
@@ -11,7 +11,7 @@ module Paysafe
11
11
  end
12
12
 
13
13
  def create_single_use_customer_token(id:)
14
- perform_post_with_object("/paymenthub/v1/customers/#{id}/singleusecustomertokens", {}, SingleUseToken)
14
+ perform_post_with_object("/paymenthub/v1/customers/#{id}/singleusecustomertokens", {}, SingleUseCustomerToken)
15
15
  end
16
16
 
17
17
  def create_payment(**data)
@@ -0,0 +1,14 @@
1
+ require 'paysafe/result'
2
+
3
+ module Paysafe
4
+ class PaymentHandle < Result
5
+ attributes :id,
6
+ :status,
7
+ :usage,
8
+ :payment_type,
9
+ :payment_handle_token,
10
+ :billing_details_id
11
+
12
+ object_attribute :Card, :card
13
+ end
14
+ end
@@ -17,14 +17,7 @@ module Paysafe
17
17
  private
18
18
 
19
19
  def camel_case_key(key)
20
- case key
21
- when Symbol
22
- camel_case(key.to_s).to_sym
23
- when String
24
- camel_case(key).to_sym
25
- else
26
- key
27
- end
20
+ camel_case(key.to_s).to_sym
28
21
  end
29
22
 
30
23
  def camel_case(string)
@@ -17,14 +17,7 @@ module Paysafe
17
17
  private
18
18
 
19
19
  def underscore_key(key)
20
- case key
21
- when Symbol
22
- underscore(key.to_s).to_sym
23
- when String
24
- underscore(key).to_sym
25
- else
26
- key
27
- end
20
+ underscore(key.to_s).to_sym
28
21
  end
29
22
 
30
23
  def underscore(string)
@@ -77,8 +77,6 @@ module Paysafe
77
77
  @attributes[key].map do |value|
78
78
  Paysafe.const_get(klass).new(value)
79
79
  end
80
- else
81
- @attributes[key]
82
80
  end
83
81
  end
84
82
 
@@ -0,0 +1,12 @@
1
+ require 'paysafe/result'
2
+
3
+ module Paysafe
4
+ class SingleUseCustomerToken < Result
5
+ attributes :id, :payment_token, :time_to_live_seconds, :customer_id,
6
+ :status, :single_use_customer_token, :locale, :first_name, :last_name,
7
+ :email
8
+
9
+ object_attribute :Address, :addresses
10
+ object_attribute :PaymentHandle, :payment_handles
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Paysafe
2
- VERSION = "0.14.0"
2
+ VERSION = "0.15.0"
3
3
  end
data/lib/paysafe.rb CHANGED
@@ -3,10 +3,12 @@ require "json"
3
3
  require "paysafe/version"
4
4
  require "paysafe/error"
5
5
  require "paysafe/single_use_token"
6
+ require "paysafe/single_use_customer_token"
6
7
  require "paysafe/profile"
7
8
  require "paysafe/customer"
8
9
  require "paysafe/payment"
9
10
  require "paysafe/gateway_response"
11
+ require "paysafe/payment_handle"
10
12
  require "paysafe/payment_processor"
11
13
  require "paysafe/payment_methods"
12
14
  require "paysafe/payment_method"
data/paysafe.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.required_ruby_version = '>= 2.5'
23
23
 
24
- spec.add_dependency "http", '>= 4', '< 5'
24
+ spec.add_dependency "http", '>= 4', '< 6'
25
25
 
26
26
  spec.add_development_dependency "rake"
27
27
  spec.add_development_dependency "bundler", "~> 2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paysafe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Julio
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2023-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5'
22
+ version: '6'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5'
32
+ version: '6'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,7 @@ extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
152
  - ".env.sample"
153
+ - ".github/dependabot.yml"
153
154
  - ".github/workflows/ci.yml"
154
155
  - ".gitignore"
155
156
  - CHANGELOG.md
@@ -161,6 +162,7 @@ files:
161
162
  - Rakefile
162
163
  - bin/console
163
164
  - bin/setup
165
+ - codecov.yml
164
166
  - lib/paysafe.rb
165
167
  - lib/paysafe/address.rb
166
168
  - lib/paysafe/api/base_api.rb
@@ -176,6 +178,7 @@ files:
176
178
  - lib/paysafe/error.rb
177
179
  - lib/paysafe/gateway_response.rb
178
180
  - lib/paysafe/payment.rb
181
+ - lib/paysafe/payment_handle.rb
179
182
  - lib/paysafe/payment_method.rb
180
183
  - lib/paysafe/payment_methods.rb
181
184
  - lib/paysafe/payment_processor.rb
@@ -184,6 +187,7 @@ files:
184
187
  - lib/paysafe/refinements/snake_case.rb
185
188
  - lib/paysafe/rest/client.rb
186
189
  - lib/paysafe/result.rb
190
+ - lib/paysafe/single_use_customer_token.rb
187
191
  - lib/paysafe/single_use_token.rb
188
192
  - lib/paysafe/standalone_credit.rb
189
193
  - lib/paysafe/verification.rb
@@ -193,7 +197,7 @@ homepage: https://github.com/jackpocket/paysafe
193
197
  licenses:
194
198
  - MIT
195
199
  metadata: {}
196
- post_install_message:
200
+ post_install_message:
197
201
  rdoc_options: []
198
202
  require_paths:
199
203
  - lib
@@ -208,8 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
212
  - !ruby/object:Gem::Version
209
213
  version: '0'
210
214
  requirements: []
211
- rubygems_version: 3.1.4
212
- signing_key:
215
+ rubygems_version: 3.4.13
216
+ signing_key:
213
217
  specification_version: 4
214
218
  summary: A Ruby interface to the Paysafe REST API.
215
219
  test_files: []