Module: Pay::Stripe
- Extended by:
- Env
- Defined in:
- lib/pay/stripe.rb,
lib/pay/stripe/error.rb,
lib/pay/stripe/charge.rb,
lib/pay/stripe/billable.rb,
lib/pay/stripe/merchant.rb,
lib/pay/stripe/subscription.rb,
lib/pay/stripe/payment_method.rb,
lib/pay/stripe/webhooks/account_updated.rb,
lib/pay/stripe/webhooks/charge_refunded.rb,
lib/pay/stripe/webhooks/charge_succeeded.rb,
lib/pay/stripe/webhooks/customer_deleted.rb,
lib/pay/stripe/webhooks/customer_updated.rb,
lib/pay/stripe/webhooks/subscription_created.rb,
lib/pay/stripe/webhooks/subscription_deleted.rb,
lib/pay/stripe/webhooks/subscription_updated.rb,
lib/pay/stripe/webhooks/subscription_renewing.rb,
lib/pay/stripe/webhooks/payment_method_updated.rb,
lib/pay/stripe/webhooks/payment_action_required.rb,
lib/pay/stripe/webhooks/payment_method_attached.rb,
lib/pay/stripe/webhooks/payment_method_detached.rb,
lib/pay/stripe/webhooks/payment_intent_succeeded.rb,
lib/pay/stripe/webhooks/checkout_session_completed.rb,
lib/pay/stripe/webhooks/checkout_session_async_payment_succeeded.rb
Defined Under Namespace
Modules: Webhooks
Classes: Billable, Charge, Error, Merchant, PaymentMethod, Subscription
Class Method Summary
collapse
Class Method Details
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
# File 'lib/pay/stripe.rb', line 53
def self.configure_webhooks
Pay::Webhooks.configure do |events|
events.subscribe "stripe.charge.succeeded", Pay::Stripe::Webhooks::ChargeSucceeded.new
events.subscribe "stripe.charge.refunded", Pay::Stripe::Webhooks::ChargeRefunded.new
events.subscribe "stripe.payment_intent.succeeded", Pay::Stripe::Webhooks::PaymentIntentSucceeded.new
events.subscribe "stripe.invoice.upcoming", Pay::Stripe::Webhooks::SubscriptionRenewing.new
events.subscribe "stripe.invoice.payment_action_required", Pay::Stripe::Webhooks::PaymentActionRequired.new
events.subscribe "stripe.customer.subscription.created", Pay::Stripe::Webhooks::SubscriptionCreated.new
events.subscribe "stripe.customer.subscription.updated", Pay::Stripe::Webhooks::SubscriptionUpdated.new
events.subscribe "stripe.customer.subscription.deleted", Pay::Stripe::Webhooks::SubscriptionDeleted.new
events.subscribe "stripe.customer.updated", Pay::Stripe::Webhooks::CustomerUpdated.new
events.subscribe "stripe.customer.deleted", Pay::Stripe::Webhooks::CustomerDeleted.new
events.subscribe "stripe.payment_method.attached", Pay::Stripe::Webhooks::PaymentMethodAttached.new
events.subscribe "stripe.payment_method.updated", Pay::Stripe::Webhooks::PaymentMethodUpdated.new
events.subscribe "stripe.payment_method.card_automatically_updated", Pay::Stripe::Webhooks::PaymentMethodUpdated.new
events.subscribe "stripe.payment_method.detached", Pay::Stripe::Webhooks::PaymentMethodDetached.new
events.subscribe "stripe.account.updated", Pay::Stripe::Webhooks::AccountUpdated.new
events.subscribe "stripe.checkout.session.completed", Pay::Stripe::Webhooks::CheckoutSessionCompleted.new
events.subscribe "stripe.checkout.session.async_payment_succeeded", Pay::Stripe::Webhooks::CheckoutSessionAsyncPaymentSucceeded.new
end
end
|
.private_key ⇒ Object
45
46
47
|
# File 'lib/pay/stripe.rb', line 45
def self.private_key
find_value_by_name(:stripe, :private_key)
end
|
.public_key ⇒ Object
41
42
43
|
# File 'lib/pay/stripe.rb', line 41
def self.public_key
find_value_by_name(:stripe, :public_key)
end
|
.setup ⇒ Object
31
32
33
34
35
36
37
38
39
|
# File 'lib/pay/stripe.rb', line 31
def self.setup
::Stripe.api_key = private_key
::Stripe.api_version = "2020-08-27"
::Stripe.set_app_info("PayRails", partner_id: "pp_partner_IqhY0UExnJYLxg", version: Pay::VERSION, url: "https://github.com/pay-rails/pay")
configure_webhooks
end
|
.signing_secret ⇒ Object
49
50
51
|
# File 'lib/pay/stripe.rb', line 49
def self.signing_secret
find_value_by_name(:stripe, :signing_secret)
end
|