pay 11.0.0 → 11.1.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 +4 -4
- data/app/models/pay/stripe/subscription.rb +8 -2
- data/app/models/pay/subscription.rb +2 -0
- data/app/views/pay/user_mailer/payment_action_required.text.erb +9 -0
- data/app/views/pay/user_mailer/payment_failed.text.erb +9 -0
- data/app/views/pay/user_mailer/receipt.text.erb +20 -0
- data/app/views/pay/user_mailer/refund.text.erb +21 -0
- data/app/views/pay/user_mailer/subscription_renewing.text.erb +8 -0
- data/app/views/pay/user_mailer/subscription_trial_ended.text.erb +8 -0
- data/app/views/pay/user_mailer/subscription_trial_will_end.text.erb +8 -0
- data/lib/pay/version.rb +1 -1
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82dd9dc3193e898e2fd8538148e9ff886b852506d80c768a26616921049fbd65
|
4
|
+
data.tar.gz: 1b85c150235a1ae4531592b6d6c5cf577e126e693c1ce516ea2b01d8199f5276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b450e4daa02317f33e74bc627728643157361f5d51d5748e37c5a372d94dabb41b28306b569f4e9c2fa4a0ca04e437f18e15007cac6ec3eb23a8a9ca190609
|
7
|
+
data.tar.gz: 1964aabb5533aba8a248164ef01b7203bf450fed5dab23859c14a1cbbdf9f90a67ac29beeb8840decd0ec4e70bd4da0d252e668b1d5b6bcbb63b3214ad16d38b
|
@@ -47,6 +47,8 @@ module Pay
|
|
47
47
|
if object.trial_end
|
48
48
|
trial_ended_at = [object.ended_at, object.trial_end].compact.min
|
49
49
|
attributes[:trial_ends_at] = Time.at(trial_ended_at)
|
50
|
+
else
|
51
|
+
attributes[:trial_ends_at] = nil
|
50
52
|
end
|
51
53
|
|
52
54
|
object.items.auto_paging_each do |subscription_item|
|
@@ -164,7 +166,7 @@ module Pay
|
|
164
166
|
cancel_now!
|
165
167
|
else
|
166
168
|
@api_record = ::Stripe::Subscription.update(processor_id, {cancel_at_period_end: true}.merge(expand_options), stripe_options)
|
167
|
-
update(ends_at:
|
169
|
+
update(ends_at: Time.at(@api_record.cancel_at))
|
168
170
|
end
|
169
171
|
rescue ::Stripe::StripeError => e
|
170
172
|
raise Pay::Stripe::Error, e
|
@@ -178,7 +180,11 @@ module Pay
|
|
178
180
|
return if canceled? && ends_at.past?
|
179
181
|
|
180
182
|
@api_record = ::Stripe::Subscription.cancel(processor_id, options.merge(expand_options), stripe_options)
|
181
|
-
update(
|
183
|
+
update(
|
184
|
+
trial_ends_at: (@api_record.trial_end ? Time.at(@api_record.trial_end) : nil),
|
185
|
+
ends_at: Time.at(@api_record.ended_at),
|
186
|
+
status: @api_record.status
|
187
|
+
)
|
182
188
|
rescue ::Stripe::StripeError => e
|
183
189
|
raise Pay::Stripe::Error, e
|
184
190
|
end
|
@@ -66,10 +66,12 @@ module Pay
|
|
66
66
|
|
67
67
|
# Does not include the last second of the trial
|
68
68
|
def on_trial?
|
69
|
+
return false if ended?
|
69
70
|
trial_ends_at? && trial_ends_at > Time.current
|
70
71
|
end
|
71
72
|
|
72
73
|
def trial_ended?
|
74
|
+
return true if ended?
|
73
75
|
trial_ends_at? && trial_ends_at <= Time.current
|
74
76
|
end
|
75
77
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Extra confirmation is needed to process your payment
|
2
|
+
|
3
|
+
Your <%= Pay.application_name %> subscription requires confirmation to process your payment to continue access.
|
4
|
+
|
5
|
+
Confirm your payment: <%= pay.payment_url(params[:payment_intent_id]) %>
|
6
|
+
|
7
|
+
If you have any questions, please hit reply and let us know.
|
8
|
+
|
9
|
+
— The <%= Pay.application_name %> Team
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Your payment was declined
|
2
|
+
|
3
|
+
We were unable to charge your payment method for your <%= Pay.application_name %> subscription. Please update your billing information.
|
4
|
+
|
5
|
+
Update billing information: <%= root_url %>
|
6
|
+
|
7
|
+
Let us know if you have any questions.
|
8
|
+
|
9
|
+
— The <%= Pay.application_name %> Team
|
@@ -0,0 +1,20 @@
|
|
1
|
+
We received payment for your <%= Pay.application_name %> subscription. Thanks for your business!
|
2
|
+
|
3
|
+
Questions? Please reply to this email.
|
4
|
+
|
5
|
+
------------------------------------
|
6
|
+
RECEIPT - SUBSCRIPTION
|
7
|
+
|
8
|
+
<%= Pay.application_name %>
|
9
|
+
Amount: <%= params[:pay_charge].amount_with_currency %>
|
10
|
+
|
11
|
+
Charged to: <%= params[:pay_charge].charged_to %>
|
12
|
+
Transaction ID: <%= params[:pay_charge].id %>
|
13
|
+
Date: <%= l params[:pay_charge].created_at %>
|
14
|
+
<% if params[:pay_charge].customer.owner.try(:extra_billing_info?) %>
|
15
|
+
<%= params[:pay_charge].customer.owner.extra_billing_info %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= Pay.business_name %>
|
19
|
+
<%= Pay.business_address %>
|
20
|
+
------------------------------------
|
@@ -0,0 +1,21 @@
|
|
1
|
+
We have processed your <%= Pay.application_name %> refund.
|
2
|
+
Please allow up to 7 business days for your refund to appear in your account
|
3
|
+
|
4
|
+
Questions? Please reply to this email.
|
5
|
+
|
6
|
+
------------------------------------
|
7
|
+
RECEIPT - REFUND
|
8
|
+
|
9
|
+
<%= Pay.application_name %>
|
10
|
+
Amount: <%= params[:pay_charge].amount_refunded_with_currency %>
|
11
|
+
|
12
|
+
Refunded to: <%= params[:pay_charge].charged_to %>
|
13
|
+
Transaction ID: <%= params[:pay_charge].id %>
|
14
|
+
Date: <%= l params[:pay_charge].created_at %>
|
15
|
+
<% if params[:pay_charge].customer.owner.try(:extra_billing_info?) %>
|
16
|
+
<%= params[:pay_charge].customer.owner.extra_billing_info %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= Pay.business_name %>
|
20
|
+
<%= Pay.business_address %>
|
21
|
+
------------------------------------
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Your upcoming <%= Pay.application_name %> subscription renewal
|
2
|
+
|
3
|
+
This is a friendly reminder that your <%= Pay.application_name %> subscription will renew automatically on <%= l params[:date].to_date, format: :long %>.
|
4
|
+
|
5
|
+
You may manage your subscription via your account: <%= root_url %>
|
6
|
+
If you have any questions, please hit reply and let us know.
|
7
|
+
|
8
|
+
— The <%= Pay.application_name %> Team
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Your <%= Pay.application_name %> trial has ended
|
2
|
+
|
3
|
+
This is just a friendly reminder that your <%= Pay.application_name %> trial has ended.
|
4
|
+
|
5
|
+
You may manage your subscription via your account: <%= root_url %>
|
6
|
+
If you have any questions, please hit reply and let us know.
|
7
|
+
|
8
|
+
— The <%= Pay.application_name %> Team
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Your <%= Pay.application_name %> trial is ending soon
|
2
|
+
|
3
|
+
This is just a friendly reminder that your <%= Pay.application_name %> trial will be ending soon.
|
4
|
+
|
5
|
+
You may manage your subscription via your account: <%= root_url %>
|
6
|
+
If you have any questions, please hit reply and let us know.
|
7
|
+
|
8
|
+
— The <%= Pay.application_name %> Team
|
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: 11.
|
4
|
+
version: 11.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -89,12 +89,19 @@ files:
|
|
89
89
|
- app/views/layouts/pay/application.html.erb
|
90
90
|
- app/views/pay/payments/show.html.erb
|
91
91
|
- app/views/pay/user_mailer/payment_action_required.html.erb
|
92
|
+
- app/views/pay/user_mailer/payment_action_required.text.erb
|
92
93
|
- app/views/pay/user_mailer/payment_failed.html.erb
|
94
|
+
- app/views/pay/user_mailer/payment_failed.text.erb
|
93
95
|
- app/views/pay/user_mailer/receipt.html.erb
|
96
|
+
- app/views/pay/user_mailer/receipt.text.erb
|
94
97
|
- app/views/pay/user_mailer/refund.html.erb
|
98
|
+
- app/views/pay/user_mailer/refund.text.erb
|
95
99
|
- app/views/pay/user_mailer/subscription_renewing.html.erb
|
100
|
+
- app/views/pay/user_mailer/subscription_renewing.text.erb
|
96
101
|
- app/views/pay/user_mailer/subscription_trial_ended.html.erb
|
102
|
+
- app/views/pay/user_mailer/subscription_trial_ended.text.erb
|
97
103
|
- app/views/pay/user_mailer/subscription_trial_will_end.html.erb
|
104
|
+
- app/views/pay/user_mailer/subscription_trial_will_end.text.erb
|
98
105
|
- config/currencies/iso.json
|
99
106
|
- config/locales/en.yml
|
100
107
|
- config/routes.rb
|