Documentation
¶
Overview ¶
Package stripe handles incoming requests from stripe.com over webhook.
Index ¶
- func HandleRequest(w http.ResponseWriter, r *http.Request, secret string) (stripe.Event, int, error)
- func ProcessEventBalance(event stripe.Event) (balance stripe.Balance, err error)
- func ProcessEventCharge(event stripe.Event) (charge stripe.Charge, err error)
- func ProcessEventCheckoutSession(event stripe.Event) (checkoutSession stripe.CheckoutSession, err error)
- func ProcessEventCoupon(event stripe.Event) (coupon stripe.Coupon, err error)
- func ProcessEventCreditNote(event stripe.Event) (creditNote stripe.CreditNote, err error)
- func ProcessEventCustomer(event stripe.Event) (customer stripe.Customer, err error)
- func ProcessEventCustomerDiscount(event stripe.Event) (discount stripe.Discount, err error)
- func ProcessEventCustomerSource(event stripe.Event) (source stripe.Source, err error)
- func ProcessEventCustomerSubscription(event stripe.Event) (subscription stripe.Subscription, err error)
- func ProcessEventCustomerTaxID(event stripe.Event) (taxID stripe.TaxID, err error)
- func ProcessEventInvoice(event stripe.Event) (invoice stripe.Invoice, err error)
- func ProcessEventInvoiceItem(event stripe.Event) (invoiceItem stripe.InvoiceItem, err error)
- func ProcessEventMandate(event stripe.Event) (mandate stripe.Mandate, err error)
- func ProcessEventPaymentIntent(event stripe.Event) (paymentIntent stripe.PaymentIntent, err error)
- func ProcessEventPaymentLink(event stripe.Event) (paymentLink stripe.PaymentLink, err error)
- func ProcessEventPaymentMethod(event stripe.Event) (paymentMethod stripe.PaymentMethod, err error)
- func ProcessEventPlan(event stripe.Event) (plan stripe.Plan, err error)
- func ProcessEventPrice(event stripe.Event) (price stripe.Price, err error)
- func ProcessEventProduct(event stripe.Event) (product stripe.Product, err error)
- func ProcessEventPromotionCode(event stripe.Event) (promotionCode stripe.PromotionCode, err error)
- func ProcessEventQuote(event stripe.Event) (quote stripe.Quote, err error)
- func ProcessEventSetupIntent(event stripe.Event) (setupIntent stripe.SetupIntent, err error)
- func ProcessEventSubscriptionSchedule(event stripe.Event) (subscriptionSchedule stripe.SubscriptionSchedule, err error)
- func ProcessEventTaxRate(event stripe.Event) (taxRate stripe.TaxRate, err error)
- func ProcessEventTaxSettings(event stripe.Event) (taxSettings stripe.TaxSettings, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleRequest ¶
func HandleRequest(w http.ResponseWriter, r *http.Request, secret string) (stripe.Event, int, error)
HandleRequest validates the incoming payload against the Stripe signature headers using the webhook signing secret and binds the raw data to a stripe.Event struct.
func ProcessEventBalance ¶
func ProcessEventBalance(event stripe.Event) (balance stripe.Balance, err error)
ProcessEventBalance processes the incoming event and binds the raw data to a stripe.Balance struct.
- https://docs.stripe.com/api/balance/balance_object
- `balance.available`
func ProcessEventCharge ¶
func ProcessEventCharge(event stripe.Event) (charge stripe.Charge, err error)
ProcessEventCharge processes the incoming event and binds the raw data to a stripe.Charge struct.
- https://docs.stripe.com/api/charges/object
- `charge.captured`
- `charge.dispute.closed`
- `charge.dispute.created`
- `charge.dispute.funds_reinstated`
- `charge.dispute.funds_withdrawn`
- `charge.dispute.updated`
- `charge.expired`
- `charge.failed`
- `charge.pending`
- `charge.refund.updated`
- `charge.refunded`
- `charge.succeeded`
- `charge.updated`
func ProcessEventCheckoutSession ¶
func ProcessEventCheckoutSession(event stripe.Event) (checkoutSession stripe.CheckoutSession, err error)
ProcessEventCheckoutSession processes the incoming event and binds the raw data to a stripe.CheckoutSession struct.
- https://docs.stripe.com/api/checkout/sessions/object
- `checkout.session.async_payment_failed`
- `checkout.session.async_payment_succeeded`
- `checkout.session.completed`
- `checkout.session.expired`
func ProcessEventCoupon ¶
func ProcessEventCoupon(event stripe.Event) (coupon stripe.Coupon, err error)
ProcessEventCoupon processes the incoming event and binds the raw data to a stripe.Coupon struct.
- https://docs.stripe.com/api/coupons/object
- `coupon.created`
- `coupon.deleted`
- `coupon.updated`
func ProcessEventCreditNote ¶
func ProcessEventCreditNote(event stripe.Event) (creditNote stripe.CreditNote, err error)
ProcessEventCreditNote processes the incoming event and binds the raw data to a stripe.CreditNote struct.
- https://docs.stripe.com/api/credit_notes/object
- `credit_note.created`
- `credit_note.updated`
- `credit_note.voided`
func ProcessEventCustomer ¶
func ProcessEventCustomer(event stripe.Event) (customer stripe.Customer, err error)
ProcessEventCustomer processes the incoming event and binds the raw data to a stripe.Customer struct.
- https://docs.stripe.com/api/customers/object
- `customer.created`
- `customer.updated`
- `customer.deleted`
func ProcessEventCustomerDiscount ¶
func ProcessEventCustomerDiscount(event stripe.Event) (discount stripe.Discount, err error)
ProcessEventCustomerDiscount processes the incoming event and binds the raw data to a stripe.Discount struct.
- https://docs.stripe.com/api/discounts/object
- `customer.discount.created`
- `customer.discount.deleted`
- `customer.discount.updated`
func ProcessEventCustomerSource ¶
func ProcessEventCustomerSource(event stripe.Event) (source stripe.Source, err error)
ProcessEventCustomerSource processes the incoming event and binds the raw data to a stripe.Source struct.
- https://docs.stripe.com/api/sources/object
- `customer.source.created`
- `customer.source.deleted`
- `customer.source.expiring`
- `customer.source.updated`
func ProcessEventCustomerSubscription ¶
func ProcessEventCustomerSubscription(event stripe.Event) (subscription stripe.Subscription, err error)
ProcessEventCustomerSubscription processes the incoming event and binds the raw data to a stripe.Subscription struct.
- https://docs.stripe.com/api/subscriptions/object
- `customer.subscription.created`
- `customer.subscription.deleted`
- `customer.subscription.paused`
- `customer.subscription.pending_update_applied`
- `customer.subscription.pending_update_expired`
- `customer.subscription.resumed`
- `customer.subscription.trial_will_end`
- `customer.subscription.updated`
func ProcessEventCustomerTaxID ¶
func ProcessEventCustomerTaxID(event stripe.Event) (taxID stripe.TaxID, err error)
ProcessEventCustomerTaxID processes the incoming event and binds the raw data to a stripe.TaxID struct.
- https://docs.stripe.com/api/tax_ids/object
- `customer.tax_id.created`
- `customer.tax_id.deleted`
- `customer.tax_id.updated`
func ProcessEventInvoice ¶
func ProcessEventInvoice(event stripe.Event) (invoice stripe.Invoice, err error)
ProcessEventInvoice processes the incoming event and binds the raw data to a stripe.Invoice struct.
- https://docs.stripe.com/api/invoices/object
- `invoice.created`
- `invoice.deleted`
- `invoice.finalization_failed`
- `invoice.finalized`
- `invoice.marked_uncollectible`
- `invoice.overdue`
- `invoice.paid`
- `invoice.payment_action_required`
- `invoice.payment_failed`
- `invoice.payment_succeeded`
- `invoice.sent`
- `invoice.upcoming`
- `invoice.updated`
- `invoice.voided`
- `invoice.will_be_due`
func ProcessEventInvoiceItem ¶
func ProcessEventInvoiceItem(event stripe.Event) (invoiceItem stripe.InvoiceItem, err error)
ProcessEventInvoiceItem processes the incoming event and binds the raw data to a stripe.InvoiceItem struct.
- https://docs.stripe.com/api/invoiceitems/object
- `invoiceitem.created`
- `invoiceitem.deleted`
func ProcessEventMandate ¶
func ProcessEventMandate(event stripe.Event) (mandate stripe.Mandate, err error)
ProcessEventMandate processes the incoming event and binds the raw data to a stripe.Mandate struct.
- https://docs.stripe.com/api/mandates/object
- `mandate.updated`
func ProcessEventPaymentIntent ¶
func ProcessEventPaymentIntent(event stripe.Event) (paymentIntent stripe.PaymentIntent, err error)
ProcessEventPaymentIntent processes the incoming event and binds the raw data to a stripe.PaymentIntent struct.
- https://docs.stripe.com/api/payment_intents/object
- `payment_intent.amount_capturable_updated`
- `payment_intent.canceled`
- `payment_intent.created`
- `payment_intent.partially_funded`
- `payment_intent.payment_failed`
- `payment_intent.processing`
- `payment_intent.requires_action`
- `payment_intent.succeeded`
func ProcessEventPaymentLink ¶
func ProcessEventPaymentLink(event stripe.Event) (paymentLink stripe.PaymentLink, err error)
ProcessEventPaymentLink processes the incoming event and binds the raw data to a stripe.PaymentLink struct.
- https://docs.stripe.com/api/payment-link/object
- `payment_link.created`
- `payment_link.updated`
func ProcessEventPaymentMethod ¶
func ProcessEventPaymentMethod(event stripe.Event) (paymentMethod stripe.PaymentMethod, err error)
ProcessEventPaymentMethod processes the incoming event and binds the raw data to a stripe.PaymentMethod struct.
- https://docs.stripe.com/api/payment_methods/object
- `payment_method.attached`
- `payment_method.automatically_updated`
- `payment_method.detached`
- `payment_method.updated`
func ProcessEventPlan ¶
func ProcessEventPlan(event stripe.Event) (plan stripe.Plan, err error)
ProcessEventPlan processes the incoming event and binds the raw data to a stripe.Plan struct.
- https://docs.stripe.com/api/plans/object
- `plan.created`
- `plan.deleted`
- `plan.updated`
func ProcessEventPrice ¶
func ProcessEventPrice(event stripe.Event) (price stripe.Price, err error)
ProcessEventPrice processes the incoming event and binds the raw data to a stripe.Price struct.
- https://docs.stripe.com/api/prices/object
- `price.created`
- `price.deleted`
- `price.updated`
func ProcessEventProduct ¶
func ProcessEventProduct(event stripe.Event) (product stripe.Product, err error)
ProcessEventProduct processes the incoming event and binds the raw data to a stripe.Product struct.
- https://docs.stripe.com/api/products/object
- `product.created`
- `product.deleted`
- `product.updated`
func ProcessEventPromotionCode ¶
func ProcessEventPromotionCode(event stripe.Event) (promotionCode stripe.PromotionCode, err error)
ProcessEventPromotionCode processes the incoming event and binds the raw data to a stripe.PromotionCode struct.
- https://docs.stripe.com/api/promotion_codes/object
- `promotion_code.created`
- `promotion_code.updated`
func ProcessEventQuote ¶
func ProcessEventQuote(event stripe.Event) (quote stripe.Quote, err error)
ProcessEventQuote processes the incoming event and binds the raw data to a stripe.Quote struct.
- https://docs.stripe.com/api/quotes/object
- `quote.accepted`
- `quote.canceled`
- `quote.created`
- `quote.finalized`
- `quote.will_expire`
func ProcessEventSetupIntent ¶
func ProcessEventSetupIntent(event stripe.Event) (setupIntent stripe.SetupIntent, err error)
ProcessEventSetupIntent processes the incoming event and binds the raw data to a stripe.SetupIntent struct.
- https://docs.stripe.com/api/setup_intents/object
- `setup_intent.canceled`
- `setup_intent.created`
- `setup_intent.requires_action`
- `setup_intent.setup_failed`
- `setup_intent.succeeded`
func ProcessEventSubscriptionSchedule ¶
func ProcessEventSubscriptionSchedule(event stripe.Event) (subscriptionSchedule stripe.SubscriptionSchedule, err error)
ProcessEventSubscriptionSchedule processes the incoming event and binds the raw data to a stripe.SubscriptionSchedule struct.
- https://docs.stripe.com/api/subscription_schedules/object
- `subscription_schedule.aborted`
- `subscription_schedule.canceled`
- `subscription_schedule.completed`
- `subscription_schedule.created`
- `subscription_schedule.expiring`
- `subscription_schedule.released`
- `subscription_schedule.updated`
func ProcessEventTaxRate ¶
func ProcessEventTaxRate(event stripe.Event) (taxRate stripe.TaxRate, err error)
ProcessEventTaxRate processes the incoming event and binds the raw data to a stripe.TaxRate struct.
- https://docs.stripe.com/api/tax_rates/object
- `tax_rate.created`
- `tax_rate.updated`
func ProcessEventTaxSettings ¶
func ProcessEventTaxSettings(event stripe.Event) (taxSettings stripe.TaxSettings, err error)
ProcessEventTaxSettings processes the incoming event and binds the raw data to a stripe.TaxSettings struct.
- https://docs.stripe.com/api/tax/settings/object
- `tax.settings.updated`
Types ¶
This section is empty.