Class: StripeHooks

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/webhookr/stripe/templates/stripe_hooks.rb

Instance Method Summary collapse

Instance Method Details

#on_account_updated(incoming) ⇒ Object

All ‘on_’ handlers are optional. Omit any you do not require. Details on the payload structure: help.stripe.com/entries/24466132-Webhook-Format

Note: You are responsible for checking ‘livemode’ on incoming payloads. See stripe.com/docs/webhooks#receiving-application-webhooks



10
11
12
13
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 10

def (incoming)
   = incoming.payload
  puts("account.updated: (#{})")
end

#on_charge_dispute_closed(incoming) ⇒ Object



40
41
42
43
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 40

def on_charge_dispute_closed(incoming)
  dispute = incoming.payload
  puts("charge.dispute.closed: (#{dispute})")
end

#on_charge_dispute_created(incoming) ⇒ Object



30
31
32
33
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 30

def on_charge_dispute_created(incoming)
  dispute = incoming.payload
  puts("charge.dispute.created: (#{dispute})")
end

#on_charge_dispute_updated(incoming) ⇒ Object



35
36
37
38
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 35

def on_charge_dispute_updated(incoming)
  dispute = incoming.payload
  puts("charge.dispute.updated: (#{dispute})")
end

#on_charge_failed(incoming) ⇒ Object



20
21
22
23
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 20

def on_charge_failed(incoming)
  charge = incoming.payload
  puts("charge.failed: (#{charge})")
end

#on_charge_refunded(incoming) ⇒ Object



25
26
27
28
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 25

def on_charge_refunded(incoming)
  charge = incoming.payload
  puts("charge.refunded: (#{charge})")
end

#on_charge_succeeded(incoming) ⇒ Object



15
16
17
18
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 15

def on_charge_succeeded(incoming)
  charge = incoming.payload
  puts("charge.succeeded: (#{charge})")
end

#on_coupon_created(incoming) ⇒ Object



45
46
47
48
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 45

def on_coupon_created(incoming)
  coupon = incoming.payload
  puts("coupon.created: (#{coupon})")
end

#on_coupon_deleted(incoming) ⇒ Object



50
51
52
53
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 50

def on_coupon_deleted(incoming)
  coupon = incoming.payload
  puts("coupon.deleted: (#{coupon})")
end

#on_customer_created(incoming) ⇒ Object



55
56
57
58
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 55

def on_customer_created(incoming)
  customer = incoming.payload
  puts("customer.created: (#{customer})")
end

#on_customer_deleted(incoming) ⇒ Object



65
66
67
68
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 65

def on_customer_deleted(incoming)
  customer = incoming.payload
  puts("customer.deleted: (#{customer})")
end

#on_customer_discount_created(incoming) ⇒ Object



70
71
72
73
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 70

def on_customer_discount_created(incoming)
  discount = incoming.payload
  puts("customer.discount.created: (#{discount})")
end

#on_customer_discount_deleted(incoming) ⇒ Object



80
81
82
83
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 80

def on_customer_discount_deleted(incoming)
  discount = incoming.payload
  puts("customer.discount.deleted: (#{discount})")
end

#on_customer_discount_updated(incoming) ⇒ Object



75
76
77
78
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 75

def on_customer_discount_updated(incoming)
  discount = incoming.payload
  puts("customer.discount.updated: (#{discount})")
end

#on_customer_subscription_created(incoming) ⇒ Object



85
86
87
88
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 85

def on_customer_subscription_created(incoming)
  subscription = incoming.payload
  puts("customer.subscription.created: (#{subscription})")
end

#on_customer_subscription_deleted(incoming) ⇒ Object



95
96
97
98
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 95

def on_customer_subscription_deleted(incoming)
  subscription = incoming.payload
  puts("customer.subscription.deleted: (#{subscription})")
end

#on_customer_subscription_updated(incoming) ⇒ Object



90
91
92
93
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 90

def on_customer_subscription_updated(incoming)
  subscription = incoming.payload
  puts("customer.subscription.updated: (#{subscription})")
end

#on_customer_updated(incoming) ⇒ Object



60
61
62
63
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 60

def on_customer_updated(incoming)
  customer = incoming.payload
  puts("customer.updated: (#{customer})")
end

#on_invoice_created(incoming) ⇒ Object



100
101
102
103
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 100

def on_invoice_created(incoming)
  invoice = incoming.payload
  puts("invoice.created: (#{invoice})")
end

#on_invoice_payment_failed(incoming) ⇒ Object



115
116
117
118
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 115

def on_invoice_payment_failed(incoming)
  invoice = incoming.payload
  puts("invoice.payment_failed: (#{invoice})")
end

#on_invoice_payment_succeeded(incoming) ⇒ Object



110
111
112
113
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 110

def on_invoice_payment_succeeded(incoming)
  invoice = incoming.payload
  puts("invoice.payment_succeeded: (#{invoice})")
end

#on_invoice_updated(incoming) ⇒ Object



105
106
107
108
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 105

def on_invoice_updated(incoming)
  invoice = incoming.payload
  puts("invoice.updated: (#{invoice})")
end

#on_invoiceitem_created(incoming) ⇒ Object



120
121
122
123
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 120

def on_invoiceitem_created(incoming)
  invoiceitem = incoming.payload
  puts("invoiceitem.created: (#{invoiceitem})")
end

#on_invoiceitem_deleted(incoming) ⇒ Object



130
131
132
133
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 130

def on_invoiceitem_deleted(incoming)
  invoiceitem = incoming.payload
  puts("invoiceitem.deleted: (#{invoiceitem})")
end

#on_invoiceitem_updated(incoming) ⇒ Object



125
126
127
128
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 125

def on_invoiceitem_updated(incoming)
  invoiceitem = incoming.payload
  puts("invoiceitem.updated: (#{invoiceitem})")
end

#on_plan_created(incoming) ⇒ Object



135
136
137
138
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 135

def on_plan_created(incoming)
  plan = incoming.payload
  puts("plan.created: (#{plan})")
end

#on_plan_deleted(incoming) ⇒ Object



145
146
147
148
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 145

def on_plan_deleted(incoming)
  plan = incoming.payload
  puts("plan.deleted: (#{plan})")
end

#on_plan_updated(incoming) ⇒ Object



140
141
142
143
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 140

def on_plan_updated(incoming)
  plan = incoming.payload
  puts("plan.updated: (#{plan})")
end

#on_transfer_created(incoming) ⇒ Object



150
151
152
153
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 150

def on_transfer_created(incoming)
  transfer = incoming.payload
  puts("transfer.created: (#{transfer})")
end

#on_transfer_failed(incoming) ⇒ Object



165
166
167
168
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 165

def on_transfer_failed(incoming)
  transfer = incoming.payload
  puts("transfer.failed: (#{transfer})")
end

#on_transfer_paid(incoming) ⇒ Object



160
161
162
163
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 160

def on_transfer_paid(incoming)
  transfer = incoming.payload
  puts("transfer.paid: (#{transfer})")
end

#on_transfer_updated(incoming) ⇒ Object



155
156
157
158
# File 'lib/generators/webhookr/stripe/templates/stripe_hooks.rb', line 155

def on_transfer_updated(incoming)
  transfer = incoming.payload
  puts("transfer.updated: (#{transfer})")
end