pay 6.1.0 → 6.1.1
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/lib/pay/receipts.rb +2 -2
- data/lib/pay/stripe/charge.rb +1 -1
- data/lib/pay/stripe/webhooks/checkout_session_completed.rb +2 -6
- data/lib/pay/version.rb +1 -1
- data/lib/pay.rb +4 -0
- 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: 17a91b33a5c76733e60014f15e285b51e77d1d4794456afba359691edc4e44c2
|
4
|
+
data.tar.gz: f7b991d7a54f7fa57a54a56571f2ee4badeeb1aaaa62dc5f2cc6f889254818d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ef34ddc4e6b0ba75abab2577d216a85af478fa22c0bc8a16d312b5979e782fac467204e66ac72f7fa4f9e0b4dfa16f879aad82b27251ed290e05353c48df92c
|
7
|
+
data.tar.gz: e8dd4dbbdc01aa58ce21228b84a69bb70df05a814ab306b9e2b417b3e178bf50732117b73cad0f01dbb04035bbeb834f2aa2052b010c042b1d5e1f7660149188
|
data/lib/pay/receipts.rb
CHANGED
@@ -119,7 +119,7 @@ module Pay
|
|
119
119
|
company: {
|
120
120
|
name: Pay.business_name,
|
121
121
|
address: Pay.business_address,
|
122
|
-
email: Pay.support_email,
|
122
|
+
email: Pay.support_email.address,
|
123
123
|
logo: Pay.business_logo
|
124
124
|
},
|
125
125
|
line_items: receipt_line_items
|
@@ -155,7 +155,7 @@ module Pay
|
|
155
155
|
company: {
|
156
156
|
name: Pay.business_name,
|
157
157
|
address: Pay.business_address,
|
158
|
-
email: Pay.support_email,
|
158
|
+
email: Pay.support_email.address,
|
159
159
|
logo: Pay.business_logo
|
160
160
|
},
|
161
161
|
line_items: pdf_line_items
|
data/lib/pay/stripe/charge.rb
CHANGED
@@ -125,7 +125,7 @@ module Pay
|
|
125
125
|
# refund!(5_00, refund_application_fee: true)
|
126
126
|
def refund!(amount_to_refund, **options)
|
127
127
|
if invoice_id.present?
|
128
|
-
description = options.delete(:description) || I18n.t("refund")
|
128
|
+
description = options.delete(:description) || I18n.t("pay.refund")
|
129
129
|
lines = [{type: :custom_line_item, description: description, quantity: 1, unit_amount: amount_to_refund}]
|
130
130
|
credit_note!(**options.merge(refund_amount: amount_to_refund, lines: lines))
|
131
131
|
else
|
@@ -3,15 +3,11 @@ module Pay
|
|
3
3
|
module Webhooks
|
4
4
|
class CheckoutSessionCompleted
|
5
5
|
def call(event)
|
6
|
-
# TODO: Also handle payment intents
|
7
|
-
|
8
6
|
locate_owner(event.data.object)
|
9
7
|
|
10
8
|
if (payment_intent_id = event.data.object.payment_intent)
|
11
|
-
payment_intent = ::Stripe::PaymentIntent.retrieve(payment_intent_id, {stripe_account: event.try(:account)}.compact)
|
12
|
-
payment_intent.
|
13
|
-
Pay::Stripe::Charge.sync(charge.id, stripe_account: event.try(:account))
|
14
|
-
end
|
9
|
+
payment_intent = ::Stripe::PaymentIntent.retrieve({id: payment_intent_id, expand: ["latest_charge"]}, {stripe_account: event.try(:account)}.compact)
|
10
|
+
Pay::Stripe::Charge.sync(payment_intent.latest_charge.id, object: payment_intent.latest_charge, stripe_account: event.try(:account))
|
15
11
|
end
|
16
12
|
|
17
13
|
if (subscription_id = event.data.object.subscription)
|
data/lib/pay/version.rb
CHANGED
data/lib/pay.rb
CHANGED
@@ -37,6 +37,10 @@ module Pay
|
|
37
37
|
mattr_accessor :business_logo
|
38
38
|
mattr_accessor :support_email
|
39
39
|
|
40
|
+
def self.support_email=(value)
|
41
|
+
@@support_email = value.is_a?(Mail::Address) ? value : Mail::Address.new(value)
|
42
|
+
end
|
43
|
+
|
40
44
|
mattr_accessor :automount_routes
|
41
45
|
@@automount_routes = true
|
42
46
|
|
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.1.
|
4
|
+
version: 6.1.1
|
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-
|
12
|
+
date: 2022-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|