paysafe 0.11.0 → 0.12.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: 043761f5f993734d6765c391951915b3e3ce890a99d5078873064b45d73bf658
4
- data.tar.gz: d57305ba747c217bd60c1d113ba708818bee2dbb33812fcb6eb51db527dee3bd
3
+ metadata.gz: 739e977d16a44e8436de3b59ab0afd10c50f25dbde30cba5e7c0ed3736c15224
4
+ data.tar.gz: e22eed86a829496812f4658869f0fab19ba1650a3450ef818ce7efb2bafa9d26
5
5
  SHA512:
6
- metadata.gz: 0e0240eabae75abf9b94e7dd938bdda6e6e691cd4dc6826b01e7731e64e1858cf1714f376742568f1e8ac08bd8d38e418368489a8c15f408a445d0fa105f0f32
7
- data.tar.gz: 469a5a7dc581414847289a9d6634dec7e0af95f5aacda3654d47ab0362a4ec3a1995b4875fef7dfee050570c62c8d45634fb7a03ea4cc8ecb70879cfadd19a4c
6
+ metadata.gz: 5e0f63eca5bf8e62a5688d38c94f65efb6547e8a71a02f79877b13ab47c18d7af42fe9e94141958e935c4316da3cd6551cdd24fe9577dbb450472d009211a2c7
7
+ data.tar.gz: 5ce5c49924cbe72b71973a39b74ff23ddd1427d53ca48ee7bd5e6318e5f145929b9ef1b87493bfd1ab3578dcf71e699e290cefb44adc43179271016cf5ec7298
@@ -1,6 +1,18 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## Unreleased
5
+
6
+ ...
7
+
8
+ ## 0.12.0 (2020-05-14)
9
+
10
+ * Added customers and single use tokens support for Payments API:
11
+ * `client.payments.create_single_use_customer_token`
12
+ * `client.payments.create_customer`
13
+ * `client.payments.get_customer`
14
+ * Removed deprecated methods on `Client` object. Please use API scoped methods defined on `payments`, `customer_vault`, or `card_payments`.
15
+
4
16
  ## 0.11.0 (2020-04-08)
5
17
 
6
18
  * Added standalone credits support for Payments API:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paysafe (0.11.0)
4
+ paysafe (0.12.0)
5
5
  http (>= 4, < 5)
6
6
 
7
7
  GEM
@@ -32,7 +32,7 @@ GEM
32
32
  http-parser (1.2.1)
33
33
  ffi-compiler (>= 1.0, < 2.0)
34
34
  minitest (5.14.0)
35
- minitest-mock_expectations (1.1.1)
35
+ minitest-mock_expectations (1.1.3)
36
36
  minitest-reporters (1.4.2)
37
37
  ansi
38
38
  builder
@@ -6,6 +6,14 @@ module Paysafe
6
6
  perform_get_with_object("/paymenthub/v1/paymentmethods?currencyCode=#{currency_code}", PaymentMethods)
7
7
  end
8
8
 
9
+ def create_customer(**data)
10
+ perform_post_with_object("/paymenthub/v1/customers", data, Customer)
11
+ end
12
+
13
+ def create_single_use_customer_token(id:)
14
+ perform_post_with_object("/paymenthub/v1/customers/#{id}/singleusecustomertokens", {}, SingleUseToken)
15
+ end
16
+
9
17
  def create_payment(**data)
10
18
  perform_post_with_object("/paymenthub/v1/payments", data, Payment)
11
19
  end
@@ -14,6 +22,10 @@ module Paysafe
14
22
  perform_post_with_object("/paymenthub/v1/standalonecredits", data, StandaloneCredit)
15
23
  end
16
24
 
25
+ def get_customer(id:)
26
+ perform_get_with_object("/paymenthub/v1/customers/#{id}", Customer)
27
+ end
28
+
17
29
  def get_payment(id:)
18
30
  perform_get_with_object("/paymenthub/v1/payments/#{id}", Payment)
19
31
  end
@@ -34,103 +34,6 @@ module Paysafe
34
34
  def payments
35
35
  @payments ||= Api::PaymentsApi.new(@config)
36
36
  end
37
-
38
- def create_single_use_token(data)
39
- warn "[DEPRECATION] 'create_single_use_token' is deprecated. Please use 'customer_vault.create_single_use_token' instead."
40
- customer_vault.create_single_use_token(**data)
41
- end
42
-
43
- def create_profile_from_token(data)
44
- warn "[DEPRECATION] 'create_profile_from_token' is deprecated. Please use 'customer_vault.create_profile' instead."
45
- customer_vault.create_profile(**data)
46
- end
47
-
48
- def create_profile(merchant_customer_id:, locale:, **args)
49
- warn "[DEPRECATION] 'create_profile' is deprecated. Please use 'customer_vault.create_profile' instead."
50
- customer_vault.create_profile(merchant_customer_id: merchant_customer_id, locale: locale, **args)
51
- end
52
-
53
- def delete_profile(id:)
54
- warn "[DEPRECATION] 'delete_profile' is deprecated. Please use 'customer_vault.delete_profile' instead."
55
- customer_vault.delete_profile(id: id)
56
- end
57
-
58
- def get_profile(id:, fields: [])
59
- warn "[DEPRECATION] 'get_profile' is deprecated. Please use 'customer_vault.get_profile' instead."
60
- customer_vault.get_profile(id: id, fields: fields)
61
- end
62
-
63
- def update_profile(id:, merchant_customer_id:, locale:, **args)
64
- warn "[DEPRECATION] 'update_profile' is deprecated. Please use 'customer_vault.update_profile' instead."
65
- customer_vault.update_profile(id: id, merchant_customer_id: merchant_customer_id, locale: locale, **args)
66
- end
67
-
68
- def create_address(profile_id:, country:, zip:, **args)
69
- warn "[DEPRECATION] 'create_address' is deprecated. Please use 'customer_vault.create_address' instead."
70
- customer_vault.create_address(profile_id: profile_id, country: country, zip: zip, **args)
71
- end
72
-
73
- def get_address(profile_id:, id:)
74
- warn "[DEPRECATION] 'get_address' is deprecated. Please use 'customer_vault.get_address' instead."
75
- customer_vault.get_address(profile_id: profile_id, id: id)
76
- end
77
-
78
- def create_card_from_token(profile_id:, token:)
79
- warn "[DEPRECATION] 'create_card_from_token' is deprecated. Please use 'customer_vault.create_card' instead."
80
- customer_vault.create_card(profile_id: profile_id, single_use_token: token)
81
- end
82
-
83
- def create_card(profile_id:, **data)
84
- warn "[DEPRECATION] 'create_card' is deprecated. Please use 'customer_vault.create_card' instead."
85
- customer_vault.create_card(profile_id: profile_id, **data)
86
- end
87
-
88
- def delete_card(profile_id:, id:)
89
- warn "[DEPRECATION] 'delete_card' is deprecated. Please use 'customer_vault.delete_card' instead."
90
- customer_vault.delete_card(profile_id: profile_id, id: id)
91
- end
92
-
93
- def get_card(profile_id:, id:)
94
- warn "[DEPRECATION] 'get_card' is deprecated. Please use 'customer_vault.get_card' instead."
95
- customer_vault.get_card(profile_id: profile_id, id: id)
96
- end
97
-
98
- def update_card(profile_id:, id:, month:, year:, **args)
99
- data = args.merge({
100
- card_expiry: {
101
- month: month,
102
- year: year
103
- }
104
- }).reject { |key, value| value.nil? }
105
- warn "[DEPRECATION] 'update_card' is deprecated. Please use 'customer_vault.update_card' instead with new params format: #{data}"
106
- customer_vault.update_card(profile_id: profile_id, id: id, **data)
107
- end
108
-
109
- def purchase(amount:, token:, merchant_ref_num:, **args)
110
- data = args.merge({
111
- amount: amount,
112
- merchant_ref_num: merchant_ref_num,
113
- settle_with_auth: true,
114
- card: {
115
- payment_token: token
116
- }
117
- })
118
- warn "[DEPRECATION] 'purchase' is deprecated. Please use 'card_payments.create_authorization' instead with new params format: #{data}"
119
- card_payments.create_authorization(**data)
120
- end
121
-
122
- def create_verification_from_token(merchant_ref_num:, token:, **args)
123
- warn "[DEPRECATION] 'create_verification_from_token' is deprecated. Please use 'card_payments.create_verification' instead with new params format."
124
- data = args.merge({
125
- merchant_ref_num: merchant_ref_num,
126
- card: {
127
- payment_token: token
128
- }
129
- })
130
-
131
- card_payments.create_verification(**data)
132
- end
133
-
134
37
  end
135
38
  end
136
39
  end
@@ -2,7 +2,8 @@ require 'paysafe/result'
2
2
 
3
3
  module Paysafe
4
4
  class SingleUseToken < Result
5
- attributes :id, :payment_token, :time_to_live_seconds
5
+ attributes :id, :payment_token, :time_to_live_seconds, :customer_id,
6
+ :status, :single_use_customer_token, :locale
6
7
 
7
8
  object_attribute :Card, :card
8
9
  object_attribute :Address, :billing_address
@@ -1,3 +1,3 @@
1
1
  module Paysafe
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
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.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Julio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.0.6
211
+ rubygems_version: 3.1.3
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: A Ruby interface to the Paysafe REST API.