pay 10.1.1 → 10.1.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddffc329aadfa7c04ea37c7a195fb26259a79f75e1433c27c42e6c78236840c7
|
4
|
+
data.tar.gz: 3f710608b74efec477fa33d5a65bb758cf77811b7deb88e2e81e87cfc90e32a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d637527e7cb85e6dd8bc2ada0af265e2575589b73be8102fd0de82bb99afb732c69a28746bb088b0e16506438797265b69dad042e708af369794d0cd4ef2f3b
|
7
|
+
data.tar.gz: 485c2cf8bbdd879955702d816f3d4f4afd339b339d7b98bb2a8f790ca5f04a575cb14066a91a7dc7aeb0037b97ef4d3f02e05cf9406a66bcb76025160a35e89b
|
@@ -49,7 +49,8 @@ module Pay
|
|
49
49
|
attributes[:trial_ends_at] = trial_period_days.to_i.days.from_now
|
50
50
|
end
|
51
51
|
|
52
|
-
|
52
|
+
# Ignore any keys that aren't attribute names
|
53
|
+
attributes.deep_stringify_keys!.slice!(*subscriptions.attribute_names)
|
53
54
|
|
54
55
|
subscriptions.create!(attributes)
|
55
56
|
end
|
@@ -117,8 +117,8 @@ module Pay
|
|
117
117
|
# capture(amount_to_capture: 15_00)
|
118
118
|
def capture(**options)
|
119
119
|
raise Pay::Stripe::Error, "no payment_intent on charge" unless payment_intent.present?
|
120
|
-
|
121
|
-
::Stripe::PaymentIntent.capture(
|
120
|
+
payment_intent_id = payment_intent.is_a?(::Stripe::PaymentIntent) ? payment_intent.id : payment_intent
|
121
|
+
::Stripe::PaymentIntent.capture(payment_intent_id, options, stripe_options)
|
122
122
|
self.class.sync(processor_id)
|
123
123
|
rescue ::Stripe::StripeError => e
|
124
124
|
raise Pay::Stripe::Error, e
|
@@ -122,7 +122,7 @@ module Pay
|
|
122
122
|
amount: amount,
|
123
123
|
currency: "usd",
|
124
124
|
customer: processor_id || api_record.id,
|
125
|
-
expand:
|
125
|
+
expand: Pay::Stripe::Charge::EXPAND.map { |option| "latest_charge.#{option}" },
|
126
126
|
return_url: root_url
|
127
127
|
}.merge(options)
|
128
128
|
|
data/lib/pay/stripe.rb
CHANGED
@@ -7,6 +7,7 @@ module Pay
|
|
7
7
|
autoload :AccountUpdated, "pay/stripe/webhooks/account_updated"
|
8
8
|
autoload :ChargeRefunded, "pay/stripe/webhooks/charge_refunded"
|
9
9
|
autoload :ChargeSucceeded, "pay/stripe/webhooks/charge_succeeded"
|
10
|
+
autoload :ChargeUpdated, "pay/stripe/webhooks/charge_updated"
|
10
11
|
autoload :CheckoutSessionCompleted, "pay/stripe/webhooks/checkout_session_completed"
|
11
12
|
autoload :CheckoutSessionAsyncPaymentSucceeded, "pay/stripe/webhooks/checkout_session_async_payment_succeeded"
|
12
13
|
autoload :CustomerDeleted, "pay/stripe/webhooks/customer_deleted"
|
@@ -72,8 +73,9 @@ module Pay
|
|
72
73
|
# Listen to the charge event to make sure we get non-subscription
|
73
74
|
# purchases as well. Invoice is only for subscriptions and manual creation
|
74
75
|
# so it does not include individual charges.
|
75
|
-
events.subscribe "stripe.charge.succeeded", Pay::Stripe::Webhooks::ChargeSucceeded.new
|
76
76
|
events.subscribe "stripe.charge.refunded", Pay::Stripe::Webhooks::ChargeRefunded.new
|
77
|
+
events.subscribe "stripe.charge.succeeded", Pay::Stripe::Webhooks::ChargeSucceeded.new
|
78
|
+
events.subscribe "stripe.charge.updated", Pay::Stripe::Webhooks::ChargeUpdated.new
|
77
79
|
|
78
80
|
events.subscribe "stripe.payment_intent.succeeded", Pay::Stripe::Webhooks::PaymentIntentSucceeded.new
|
79
81
|
|
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: 10.1.
|
4
|
+
version: 10.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- lib/pay/stripe/webhooks/account_updated.rb
|
142
142
|
- lib/pay/stripe/webhooks/charge_refunded.rb
|
143
143
|
- lib/pay/stripe/webhooks/charge_succeeded.rb
|
144
|
+
- lib/pay/stripe/webhooks/charge_updated.rb
|
144
145
|
- lib/pay/stripe/webhooks/checkout_session_async_payment_succeeded.rb
|
145
146
|
- lib/pay/stripe/webhooks/checkout_session_completed.rb
|
146
147
|
- lib/pay/stripe/webhooks/customer_deleted.rb
|