pay 2.2.1 → 2.2.2
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 +18 -1
- data/app/controllers/pay/payments_controller.rb +1 -0
- data/app/views/pay/payments/show.html.erb +1 -1
- data/lib/generators/active_record/pay_generator.rb +1 -1
- data/lib/generators/pay/orm_helpers.rb +1 -2
- data/lib/pay.rb +2 -2
- data/lib/pay/billable.rb +2 -2
- data/lib/pay/braintree/billable.rb +4 -4
- data/lib/pay/stripe.rb +1 -1
- data/lib/pay/stripe/billable.rb +2 -2
- data/lib/pay/stripe/subscription.rb +1 -1
- data/lib/pay/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b0dc3430e6f89e4c1516a122bde97173ee5bdb1bfa835bb968b36083b633c4f
|
4
|
+
data.tar.gz: 0dbd1c62002fa67fbf9e78591f52199c9322e6d52868fb443e640f93dd2863d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e108e2377cfabdd8da381f225094d4f8f2e0fb25ca28dbadf0cfbfaad1bbafbbb1f4613c92ac0bd8dc0d87c4de14b21d32004ab31ab572588bef4926746f92
|
7
|
+
data.tar.gz: 68ebaeed4f068419a51860d853bd914ba6c5076e590bac85005feb431a404bb7ea8c3fbbe113876e0f6ec56ad539d43e698504b99aa5951bc76894d18961f8c6
|
data/README.md
CHANGED
@@ -506,6 +506,20 @@ You can also use the `STRIPE_PRIVATE_KEY` and `STRIPE_SIGNING_SECRET` environmen
|
|
506
506
|
|
507
507
|
**To see how to use Stripe Elements JS & Devise, [click here](https://github.com/jasoncharnes/pay/wiki/Using-Stripe-Elements-and-Devise).**
|
508
508
|
|
509
|
+
You need the following event types to trigger the webhook:
|
510
|
+
|
511
|
+
```
|
512
|
+
customer.subscription.updated
|
513
|
+
customer.subscription.deleted
|
514
|
+
customer.subscription.created
|
515
|
+
payment_method.updated
|
516
|
+
invoice.payment_action_required
|
517
|
+
customer.updated
|
518
|
+
customer.deleted
|
519
|
+
charge.succeeded
|
520
|
+
charge.refunded
|
521
|
+
```
|
522
|
+
|
509
523
|
##### Strong Customer Authentication (SCA)
|
510
524
|
|
511
525
|
Our Stripe integration **requires** the use of Payment Method objects to correctly support Strong Customer Authentication with Stripe. If you've previously been using card tokens, you'll need to upgrade your Javascript integration.
|
@@ -552,7 +566,10 @@ If you have an issue you'd like to submit, please do so using the issue tracker
|
|
552
566
|
|
553
567
|
If you'd like to open a PR please make sure the following things pass:
|
554
568
|
|
555
|
-
|
569
|
+
```ruby
|
570
|
+
bin/rails db:test:prepare
|
571
|
+
bin/rails test
|
572
|
+
```
|
556
573
|
|
557
574
|
## License
|
558
575
|
|
@@ -51,7 +51,7 @@
|
|
51
51
|
</div>
|
52
52
|
<% end %>
|
53
53
|
|
54
|
-
<%= link_to t("back"),
|
54
|
+
<%= link_to t("back"), @redirect_to, class: "inline-block w-full px-4 py-3 bg-gray-200 hover:bg-gray-300 text-center text-gray-700 rounded-lg" %>
|
55
55
|
</div>
|
56
56
|
|
57
57
|
<p class="text-center text-gray-500 text-sm">
|
@@ -26,7 +26,7 @@ module ActiveRecord
|
|
26
26
|
end
|
27
27
|
|
28
28
|
indent_depth = class_path.size - 1
|
29
|
-
content = content.split("\n").map { |line| " " * indent_depth + line }
|
29
|
+
content = content.split("\n").map { |line| " " * indent_depth + line }.join("\n") << "\n"
|
30
30
|
|
31
31
|
inject_into_class(model_path, class_path.last, content) if model_exists?
|
32
32
|
end
|
data/lib/pay.rb
CHANGED
@@ -105,7 +105,7 @@ module Pay
|
|
105
105
|
class BraintreeError < Error
|
106
106
|
attr_reader :result
|
107
107
|
|
108
|
-
def initialize(result=nil)
|
108
|
+
def initialize(result = nil)
|
109
109
|
@result = result
|
110
110
|
end
|
111
111
|
end
|
@@ -124,7 +124,7 @@ module Pay
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def message
|
127
|
-
"This payment attempt failed
|
127
|
+
"This payment attempt failed because of an invalid payment method."
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
data/lib/pay/billable.rb
CHANGED
@@ -20,8 +20,8 @@ module Pay
|
|
20
20
|
include Pay::Stripe::Billable if defined? ::Stripe
|
21
21
|
include Pay::Braintree::Billable if defined? ::Braintree
|
22
22
|
|
23
|
-
has_many :charges, class_name: Pay.chargeable_class, foreign_key: :owner_id, inverse_of: :owner
|
24
|
-
has_many :subscriptions, class_name: Pay.subscription_class, foreign_key: :owner_id, inverse_of: :owner
|
23
|
+
has_many :charges, class_name: Pay.chargeable_class, foreign_key: :owner_id, inverse_of: :owner, as: :owner
|
24
|
+
has_many :subscriptions, class_name: Pay.subscription_class, foreign_key: :owner_id, inverse_of: :owner, as: :owner
|
25
25
|
|
26
26
|
attribute :plan, :string
|
27
27
|
attribute :quantity, :integer
|
@@ -24,7 +24,7 @@ module Pay
|
|
24
24
|
|
25
25
|
result.customer
|
26
26
|
end
|
27
|
-
rescue ::Braintree::AuthorizationError
|
27
|
+
rescue ::Braintree::AuthorizationError
|
28
28
|
raise BraintreeAuthorizationError
|
29
29
|
rescue ::Braintree::BraintreeError => e
|
30
30
|
raise BraintreeError, e.message
|
@@ -44,7 +44,7 @@ module Pay
|
|
44
44
|
raise BraintreeError.new(result), result.message unless result.success?
|
45
45
|
|
46
46
|
save_braintree_transaction(result.transaction)
|
47
|
-
rescue ::Braintree::AuthorizationError
|
47
|
+
rescue ::Braintree::AuthorizationError
|
48
48
|
raise BraintreeAuthorizationError
|
49
49
|
rescue ::Braintree::BraintreeError => e
|
50
50
|
raise BraintreeError, e.message
|
@@ -71,7 +71,7 @@ module Pay
|
|
71
71
|
raise BraintreeError.new(result), result.message unless result.success?
|
72
72
|
|
73
73
|
create_subscription(result.subscription, "braintree", name, plan, status: :active)
|
74
|
-
rescue ::Braintree::AuthorizationError
|
74
|
+
rescue ::Braintree::AuthorizationError
|
75
75
|
raise BraintreeAuthorizationError
|
76
76
|
rescue ::Braintree::BraintreeError => e
|
77
77
|
raise BraintreeError, e.message
|
@@ -94,7 +94,7 @@ module Pay
|
|
94
94
|
update_braintree_card_on_file result.payment_method
|
95
95
|
update_subscriptions_to_payment_method(result.payment_method.token)
|
96
96
|
true
|
97
|
-
rescue ::Braintree::AuthorizationError
|
97
|
+
rescue ::Braintree::AuthorizationError
|
98
98
|
raise BraintreeAuthorizationError
|
99
99
|
rescue ::Braintree::BraintreeError => e
|
100
100
|
raise BraintreeError, e.message
|
data/lib/pay/stripe.rb
CHANGED
data/lib/pay/stripe/billable.rb
CHANGED
@@ -97,7 +97,7 @@ module Pay
|
|
97
97
|
def update_stripe_email!
|
98
98
|
customer = stripe_customer
|
99
99
|
customer.email = email
|
100
|
-
customer.
|
100
|
+
customer.name = customer_name
|
101
101
|
customer.save
|
102
102
|
end
|
103
103
|
|
@@ -137,7 +137,7 @@ module Pay
|
|
137
137
|
private
|
138
138
|
|
139
139
|
def create_stripe_customer
|
140
|
-
customer = ::Stripe::Customer.create(email: email,
|
140
|
+
customer = ::Stripe::Customer.create(email: email, name: customer_name)
|
141
141
|
update(processor: "stripe", processor_id: customer.id)
|
142
142
|
|
143
143
|
# Update the user's card on file if a token was passed in
|
@@ -37,7 +37,7 @@ module Pay
|
|
37
37
|
subscription = processor_subscription
|
38
38
|
subscription.cancel_at_period_end = false
|
39
39
|
subscription.plan = plan
|
40
|
-
subscription.proration_behavior = (prorate ?
|
40
|
+
subscription.proration_behavior = (prorate ? "create_prorations" : "none")
|
41
41
|
subscription.trial_end = on_trial? ? trial_ends_at.to_i : "now"
|
42
42
|
subscription.quantity = quantity if quantity?
|
43
43
|
subscription.save
|
data/lib/pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
8
8
|
- Chris Oliver
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -258,7 +258,7 @@ homepage: https://github.com/jasoncharnes/pay
|
|
258
258
|
licenses:
|
259
259
|
- MIT
|
260
260
|
metadata: {}
|
261
|
-
post_install_message:
|
261
|
+
post_install_message:
|
262
262
|
rdoc_options: []
|
263
263
|
require_paths:
|
264
264
|
- lib
|
@@ -273,8 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
rubygems_version: 3.1.
|
277
|
-
signing_key:
|
276
|
+
rubygems_version: 3.1.4
|
277
|
+
signing_key:
|
278
278
|
specification_version: 4
|
279
279
|
summary: A Ruby on Rails subscription engine.
|
280
280
|
test_files: []
|