pay 8.1.0 → 8.1.2
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: 2c9bcfe2386dfbf2f1aef6f5f531dfee84f79e7e46e8a50bfa1189d65cf968e9
|
4
|
+
data.tar.gz: 95d4b7d998ac2439ddcd8e3c174c0349aa4cb131b1477fc166948d1997ae67e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f8ac8309e3d664980c0a6991440197b01de09d8de04c352bd20d6b3a97127fed7dad70f4511056fee585fd45c8014d1af796b75f9da21b2b8a1ef500162856
|
7
|
+
data.tar.gz: 41b2c842364d6517c4fe40c253424d4a7c45f47aa0fa35dd3dfe7c5ef3f4c79cdcc2fefef53294689986264b09ad3310f3079e3dd63736dc6bf9ab7533154deb
|
@@ -9,7 +9,7 @@ module Pay
|
|
9
9
|
|
10
10
|
attributes = {
|
11
11
|
current_period_end: object.renews_at,
|
12
|
-
ends_at: (object.ends_at ? Time.parse(object
|
12
|
+
ends_at: (object.ends_at ? Time.parse(object.ends_at) : nil),
|
13
13
|
pause_starts_at: (object.pause&.resumes_at ? Time.parse(object.pause.resumes_at) : nil),
|
14
14
|
status: object.status,
|
15
15
|
processor_plan: object.first_subscription_item.price_id,
|
@@ -102,7 +102,11 @@ module Pay
|
|
102
102
|
quantity: quantity
|
103
103
|
}]
|
104
104
|
|
105
|
-
::Paddle::Subscription.update(
|
105
|
+
::Paddle::Subscription.update(
|
106
|
+
id: processor_id,
|
107
|
+
items: items,
|
108
|
+
proration_billing_mode: options.delete(:proration_billing_mode) || "prorated_immediately"
|
109
|
+
)
|
106
110
|
update(quantity: quantity)
|
107
111
|
rescue ::Paddle::Error => e
|
108
112
|
raise Pay::PaddleBilling::Error, e
|
@@ -148,12 +152,18 @@ module Pay
|
|
148
152
|
end
|
149
153
|
|
150
154
|
def swap(plan, **options)
|
155
|
+
raise ArgumentError, "plan must be a string" unless plan.is_a?(String)
|
156
|
+
|
151
157
|
items = [{
|
152
158
|
price_id: plan,
|
153
159
|
quantity: quantity || 1
|
154
160
|
}]
|
155
161
|
|
156
|
-
::Paddle::Subscription.update(
|
162
|
+
::Paddle::Subscription.update(
|
163
|
+
id: processor_id,
|
164
|
+
items: items,
|
165
|
+
proration_billing_mode: options.delete(:proration_billing_mode) || "prorated_immediately"
|
166
|
+
)
|
157
167
|
update(processor_plan: plan, ends_at: nil, status: :active)
|
158
168
|
end
|
159
169
|
|
@@ -332,7 +332,7 @@ module Pay
|
|
332
332
|
|
333
333
|
# Retries the latest invoice for a Past Due subscription and attempts to pay it
|
334
334
|
def retry_failed_payment(payment_intent_id: nil)
|
335
|
-
payment_intent_id ||=
|
335
|
+
payment_intent_id ||= api_record.latest_invoice.payment_intent.id
|
336
336
|
payment_intent = ::Stripe::PaymentIntent.retrieve({id: payment_intent_id}, stripe_options)
|
337
337
|
|
338
338
|
payment_intent = if payment_intent.status == "requires_payment_method"
|
data/lib/pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.1.
|
4
|
+
version: 8.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-10-
|
13
|
+
date: 2024-10-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|