pay 6.0.3 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pay might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/mailers/pay/user_mailer.rb +1 -1
- data/app/views/pay/user_mailer/payment_action_required.html.erb +2 -2
- data/app/views/pay/user_mailer/receipt.html.erb +5 -4
- data/app/views/pay/user_mailer/refund.html.erb +4 -4
- data/app/views/pay/user_mailer/subscription_renewing.html.erb +4 -4
- data/app/views/pay/user_mailer/subscription_trial_ended.html.erb +4 -4
- data/app/views/pay/user_mailer/subscription_trial_will_end.html.erb +4 -4
- data/config/locales/en.yml +6 -6
- data/lib/pay/braintree/subscription.rb +4 -3
- data/lib/pay/version.rb +1 -1
- data/lib/pay.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beaa5a643c27c8dde835fe7593a12971c4c060fe5b2bb44c9790a61430d4570b
|
4
|
+
data.tar.gz: 59b45703f436c77744623190946ae7e57f03627530e539c643510d82b35ee426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17b2cbc585ca9e78c21e859483f92ede7d37588baa404cef2a67b8f8f9c57169def03487925cf0b1238fd662c952e7e5716960f0d9257eace5815855cbe9e2a8
|
7
|
+
data.tar.gz: 5ed7a082eee1b3c053cf39feffc25a7a07f837e14fe0a8267fcd7bb2ec851d1858063f9c3bdbaff76aad20b8c57effa31c4d1acf96804426c22e5419da4f198c
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Want to see how Pay works? Check out our video getting started guide.
|
|
20
20
|
|
21
21
|
Our supported payment processors are:
|
22
22
|
|
23
|
-
- Stripe ([SCA Compatible](https://stripe.com/docs/strong-customer-authentication) using API version `2022-
|
23
|
+
- Stripe ([SCA Compatible](https://stripe.com/docs/strong-customer-authentication) using API version `2022-11-15`)
|
24
24
|
- Paddle (SCA Compatible & supports PayPal)
|
25
25
|
- Braintree (supports PayPal)
|
26
26
|
- [Fake Processor](docs/fake_processor/1_overview.md) (used for generic trials without cards, free subscriptions, testing, etc)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h3>Extra confirmation is needed to process your payment</h3>
|
2
|
-
<p>Your <%= Pay.
|
2
|
+
<p>Your <%= Pay.application_name %> subscription requires confirmation to process your payment to continue access.</p>
|
3
3
|
|
4
4
|
<p><%= link_to "Click here to confirm your payment", pay.payment_url(params[:payment_intent_id]) %>. If you have any questions, please hit reply and let us know.</p>
|
5
5
|
|
6
|
-
<p
|
6
|
+
<p>— The <%= Pay.application_name %> Team</p>
|
@@ -1,20 +1,21 @@
|
|
1
|
-
We received payment for your subscription. Thanks for your business!<br/>
|
1
|
+
We received payment for your <%= link_to Pay.application_name, root_url %> subscription. Thanks for your business!<br/>
|
2
2
|
<br/>
|
3
3
|
Questions? Please reply to this email.<br/>
|
4
4
|
<br/>
|
5
5
|
------------------------------------<br/>
|
6
6
|
RECEIPT - SUBSCRIPTION<br/>
|
7
7
|
<br/>
|
8
|
+
|
9
|
+
<%= Pay.application_name %><br/>
|
8
10
|
Amount: <%= params[:pay_charge].amount_with_currency %><br/>
|
9
11
|
<br/>
|
10
12
|
Charged to: <%= params[:pay_charge].charged_to %><br/>
|
11
13
|
Transaction ID: <%= params[:pay_charge].id %><br/>
|
12
|
-
Date: <%= params[:pay_charge].created_at %><br/>
|
14
|
+
Date: <%= l params[:pay_charge].created_at %><br/>
|
13
15
|
<% if params[:pay_charge].customer.owner.try(:extra_billing_info?) %>
|
14
16
|
<%= params[:pay_charge].customer.owner.extra_billing_info %><br/>
|
15
17
|
<% end %>
|
16
18
|
<br/>
|
17
19
|
<br/>
|
18
|
-
<%= Pay.business_name
|
19
|
-
<%= simple_format Pay.business_address %>
|
20
|
+
<%= simple_format [Pay.business_name, Pay.business_address].join("\n") %>
|
20
21
|
------------------------------------<br/>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
We have processed your refund.<br/>
|
1
|
+
We have processed your <%= link_to Pay.application_name, root_url %> refund.<br/>
|
2
2
|
Please allow up to 7 business days for your refund to appear in your account<br/>
|
3
3
|
<br/>
|
4
4
|
Questions? Please reply to this email.<br/>
|
@@ -6,16 +6,16 @@ Questions? Please reply to this email.<br/>
|
|
6
6
|
------------------------------------<br/>
|
7
7
|
RECEIPT - REFUND<br/>
|
8
8
|
<br/>
|
9
|
+
<%= Pay.application_name %><br/>
|
9
10
|
Amount: <%= params[:pay_charge].amount_refunded_with_currency %><br/>
|
10
11
|
<br/>
|
11
12
|
Refunded to: <%= params[:pay_charge].charged_to %><br/>
|
12
13
|
Transaction ID: <%= params[:pay_charge].id %><br/>
|
13
|
-
Date: <%= params[:pay_charge].created_at %><br/>
|
14
|
+
Date: <%= l params[:pay_charge].created_at %><br/>
|
14
15
|
<% if params[:pay_charge].customer.owner.try(:extra_billing_info?) %>
|
15
16
|
<%= params[:pay_charge].customer.owner.extra_billing_info %><br/>
|
16
17
|
<% end %>
|
17
18
|
<br/>
|
18
19
|
<br/>
|
19
|
-
<%= Pay.business_name
|
20
|
-
<%= simple_format Pay.business_address %>
|
20
|
+
<%= simple_format [Pay.business_name, Pay.business_address].join("\n") %>
|
21
21
|
------------------------------------<br/>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<h3>Your upcoming subscription renewal</h3>
|
2
|
-
<p>This is just a friendly reminder that your <%= Pay.
|
1
|
+
<h3>Your upcoming <%= Pay.application_name %> subscription renewal</h3>
|
2
|
+
<p>This is just a friendly reminder that your <%= link_to Pay.application_name, root_url %> subscription will renew automatically on <%= l params[:date].to_date, format: :long %>.</p>
|
3
3
|
|
4
|
-
<p>You may manage your subscription via your account. If you have any questions, please hit reply and let us know.</p>
|
4
|
+
<p>You may <%= link_to "manage your subscription", root_url %> via your account. If you have any questions, please hit reply and let us know.</p>
|
5
5
|
|
6
|
-
<p
|
6
|
+
<p>— The <%= Pay.application_name %> Team</p>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<h3>Your <%= Pay.
|
2
|
-
<p>This is just a friendly reminder that your <%= Pay.
|
1
|
+
<h3>Your <%= Pay.application_name %> trial has ended</h3>
|
2
|
+
<p>This is just a friendly reminder that your <%= link_to Pay.application_name, root_url %> trial has ended.</p>
|
3
3
|
|
4
|
-
<p>You may manage your subscription via your account. If you have any questions, please hit reply and let us know.</p>
|
4
|
+
<p>You may <%= link_to "manage your subscription", root_url %> via your account. If you have any questions, please hit reply and let us know.</p>
|
5
5
|
|
6
|
-
<p
|
6
|
+
<p>— The <%= Pay.application_name %> Team</p>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<h3>Your <%= Pay.
|
2
|
-
<p>This is just a friendly reminder that your <%= Pay.
|
1
|
+
<h3>Your <%= Pay.application_name %> trial is ending soon</h3>
|
2
|
+
<p>This is just a friendly reminder that your <%= link_to Pay.application_name, root_url %> trial will be ending soon.</p>
|
3
3
|
|
4
|
-
<p>You may manage your subscription via your account. If you have any questions, please hit reply and let us know.</p>
|
4
|
+
<p>You may <%= link_to "manage your subscription", root_url %> via your account. If you have any questions, please hit reply and let us know.</p>
|
5
5
|
|
6
|
-
<p
|
6
|
+
<p>— The <%= Pay.application_name %> Team</p>
|
data/config/locales/en.yml
CHANGED
@@ -49,14 +49,14 @@ en:
|
|
49
49
|
authorization: "Either the data you submitted is malformed and does not match the API or the API key you used may not be authorized to perform this action."
|
50
50
|
user_mailer:
|
51
51
|
receipt:
|
52
|
-
subject: "Payment receipt"
|
52
|
+
subject: "[%{application}] Payment receipt"
|
53
53
|
refund:
|
54
|
-
subject: "Payment refunded"
|
54
|
+
subject: "[%{application}] Payment refunded"
|
55
55
|
subscription_renewing:
|
56
|
-
subject: "Your upcoming subscription renewal"
|
56
|
+
subject: "[%{application}] Your upcoming subscription renewal"
|
57
57
|
payment_action_required:
|
58
|
-
subject: "Confirm your payment"
|
58
|
+
subject: "[%{application}] Confirm your payment"
|
59
59
|
subscription_trial_will_end:
|
60
|
-
subject: "Your trial is ending soon"
|
60
|
+
subject: "[%{application}] Your trial is ending soon"
|
61
61
|
subscription_trial_ended:
|
62
|
-
subject: "Your trial has ended"
|
62
|
+
subject: "[%{application}] Your trial has ended"
|
@@ -217,7 +217,7 @@ module Pay
|
|
217
217
|
add: [
|
218
218
|
{
|
219
219
|
inherited_from_id: "plan-credit",
|
220
|
-
amount: discount.amount,
|
220
|
+
amount: discount.amount.round(2),
|
221
221
|
number_of_billing_cycles: discount.number_of_billing_cycles
|
222
222
|
}
|
223
223
|
]
|
@@ -225,9 +225,10 @@ module Pay
|
|
225
225
|
}
|
226
226
|
end
|
227
227
|
|
228
|
-
|
229
|
-
|
228
|
+
# If subscribe fails we will raise a Pay::Braintree::Error and not cancel the current subscription
|
230
229
|
customer.subscribe(**options.merge(name: name, plan: plan.id))
|
230
|
+
|
231
|
+
cancel_now!
|
231
232
|
end
|
232
233
|
end
|
233
234
|
end
|
data/lib/pay/version.rb
CHANGED
data/lib/pay.rb
CHANGED
@@ -80,15 +80,16 @@ module Pay
|
|
80
80
|
|
81
81
|
# Should return a hash of arguments for the `mail` call in UserMailer
|
82
82
|
mattr_accessor :mail_arguments
|
83
|
-
@@mail_arguments = ->
|
83
|
+
@@mail_arguments = -> {
|
84
84
|
{
|
85
|
-
to: Pay.mail_to
|
85
|
+
to: instance_exec(&Pay.mail_to),
|
86
|
+
subject: default_i18n_subject(application: Pay.application_name)
|
86
87
|
}
|
87
88
|
}
|
88
89
|
|
89
90
|
# Should return String or Array of email recipients
|
90
91
|
mattr_accessor :mail_to
|
91
|
-
@@mail_to = ->
|
92
|
+
@@mail_to = -> {
|
92
93
|
if ActionMailer::Base.respond_to?(:email_address_with_name)
|
93
94
|
ActionMailer::Base.email_address_with_name(params[:pay_customer].email, params[:pay_customer].customer_name)
|
94
95
|
else
|
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: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-11-
|
12
|
+
date: 2022-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|