pay 6.1.0 → 6.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.
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 +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 863cb9c39a6232694d37073f367ebc22f78a0fc7c4c775e9f0b9b64555fc5534
|
4
|
+
data.tar.gz: 0c2bae743a6e14f8f3608e76f7d515e3411d1d417e74e7e1a1a5dc8a99ec2b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af822c88226e681feb85f173a9eb15ab161926be39b08d6e4944b50db67f4b5dcf95b6fa443b3dd460b592627539cdc9769fccd82552ee36c90735201411782
|
7
|
+
data.tar.gz: a81b84cc6fe417b823b7b109066b0ed39da420fe2fe611b28e87feaff7ffb084b1c2fd8b65b163317fc033911277d070f73c33edf122c00aff89031a9644d633
|
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}, {stripe_account: event.try(:account)}.compact)
|
10
|
+
Pay::Stripe::Charge.sync(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.2
|
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-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
rubygems_version: 3.3.
|
223
|
+
rubygems_version: 3.3.26
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Payments engine for Ruby on Rails
|