Documentation
¶
Index ¶
- type Base
- type Examples
- func (ex *Examples) ChargeCaptured() error
- func (ex *Examples) ChargeFailed() error
- func (ex *Examples) ChargeSucceeded() error
- func (ex *Examples) CustomerCreated() error
- func (ex *Examples) CustomerSourceCreated() error
- func (ex *Examples) CustomerSourceUpdated() error
- func (ex *Examples) CustomerSubscriptionUpdated() error
- func (ex *Examples) CustomerUpdated() error
- func (ex *Examples) InvoiceCreated() error
- func (ex *Examples) InvoiceFinalized() error
- func (ex *Examples) InvoicePaymentSucceeded() error
- func (ex *Examples) InvoiceUpdated() error
- func (ex *Examples) PaymentIntentCreated() error
- func (ex *Examples) PaymentIntentFailed() error
- func (ex *Examples) PaymentIntentSucceeded() error
- func (ex *Examples) PaymentMethodAttached() error
- func (ex *Examples) WebhookEndpointsList() WebhookEndpointList
- type RequestParameters
- type WebhookEndpoint
- type WebhookEndpointList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { Cmd *cobra.Command Method string Profile *config.Profile Parameters RequestParameters // SuppressOutput is used by `trigger` to hide output SuppressOutput bool APIBaseURL string // contains filtered or unexported fields }
Base does stuff
func (*Base) MakeRequest ¶
func (rb *Base) MakeRequest(secretKey, path string, params *RequestParameters) ([]byte, error)
MakeRequest will make a request to the Stripe API with the specific variables given to it
type Examples ¶
Examples stores possible webhook test events to trigger for the CLI
func (*Examples) ChargeCaptured ¶
ChargeCaptured first creates a charge that is not captured, then sends another request to specifically capture it to trigger the captured event
func (*Examples) ChargeFailed ¶
ChargeFailed fails to create a charge
func (*Examples) ChargeSucceeded ¶
ChargeSucceeded successfully creates a charge
func (*Examples) CustomerCreated ¶
CustomerCreated creates a new customer
func (*Examples) CustomerSourceCreated ¶
CustomerSourceCreated creates a customer and a token then attaches the card to the customer
func (*Examples) CustomerSourceUpdated ¶
CustomerSourceUpdated creates a customer, adds a card, adds metadata to the card to trigger an update
func (*Examples) CustomerSubscriptionUpdated ¶
CustomerSubscriptionUpdated creates a customer with a card, creates a plan, adds the customer to the plan, then updates the new subscription
func (*Examples) CustomerUpdated ¶
CustomerUpdated creates a new customer and adds metadata to trigger an update event
func (*Examples) InvoiceCreated ¶
InvoiceCreated first creates a customer, adds an invoice item, then creates an invoice.
func (*Examples) InvoiceFinalized ¶
InvoiceFinalized first creates a customer, adds an invoice item, creates an invoice, and then finalizes the invoice.
func (*Examples) InvoicePaymentSucceeded ¶
InvoicePaymentSucceeded first creates a customer, adds an invoice item, creates the invoice, and then pays the invoice
func (*Examples) InvoiceUpdated ¶
InvoiceUpdated first creates a customer, adds an invoice item, creates the invoice, then adds metadata to the invoice to trigger an update
func (*Examples) PaymentIntentCreated ¶
PaymentIntentCreated creates a payment intent. Requires the data to be assigned to the payment intent
func (*Examples) PaymentIntentFailed ¶
PaymentIntentFailed creates a failed payment intent
func (*Examples) PaymentIntentSucceeded ¶
PaymentIntentSucceeded creates a successful payment intent
func (*Examples) PaymentMethodAttached ¶
PaymentMethodAttached creates a customer and payment method, then attaches the customer to the payment method
func (*Examples) WebhookEndpointsList ¶
func (ex *Examples) WebhookEndpointsList() WebhookEndpointList
WebhookEndpointsList returns all the webhook endpoints on a users' account
type RequestParameters ¶ added in v0.2.1
type RequestParameters struct {
// contains filtered or unexported fields
}
RequestParameters captures the structure of the parameters that can be sent to Stripe
func (*RequestParameters) AppendData ¶ added in v0.5.0
func (r *RequestParameters) AppendData(data []string)
type WebhookEndpoint ¶
type WebhookEndpoint struct { Application string `json:"application"` EnabledEvents []string `json:"enabled_events"` URL string `json:"url"` }
WebhookEndpoint contains the data for each webhook endpoint
type WebhookEndpointList ¶
type WebhookEndpointList struct {
Data []WebhookEndpoint `json:"data"`
}
WebhookEndpointList contains the list of webhook endpoints for the account