Documentation
¶
Index ¶
- type Base
- type Examples
- func (ex *Examples) ChargeCaptured() error
- func (ex *Examples) ChargeDisputed() error
- func (ex *Examples) ChargeFailed() error
- func (ex *Examples) ChargeRefunded() error
- func (ex *Examples) ChargeSucceeded() error
- func (ex *Examples) CheckoutSessionCompleted() error
- func (ex *Examples) CustomerCreated() error
- func (ex *Examples) CustomerDeleted() error
- func (ex *Examples) CustomerSourceCreated() error
- func (ex *Examples) CustomerSourceUpdated() error
- func (ex *Examples) CustomerSubscriptionDeleted() error
- func (ex *Examples) CustomerSubscriptionUpdated() error
- func (ex *Examples) CustomerUpdated() error
- func (ex *Examples) InvoiceCreated() error
- func (ex *Examples) InvoiceFinalized() error
- func (ex *Examples) InvoicePaymentFailed() 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) ResendEvent(id string) 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
DarkStyle bool
APIBaseURL string
Livemode bool
// contains filtered or unexported fields
}
Base encapsulates the required information needed to make requests to the API
func (*Base) MakeRequest ¶
func (rb *Base) MakeRequest(apiKey, 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) ChargeDisputed ¶ added in v0.6.8
ChargeDisputed creates a charge that becomes disputed
func (*Examples) ChargeFailed ¶
ChargeFailed fails to create a charge
func (*Examples) ChargeRefunded ¶ added in v0.6.8
ChargeRefunded creates a charge, then refunds it
func (*Examples) ChargeSucceeded ¶
ChargeSucceeded successfully creates a charge
func (*Examples) CheckoutSessionCompleted ¶ added in v0.6.10
CheckoutSessionCompleted creates and completes a Checkout session https://stripe.com/docs/api/checkout/sessions/create?lang=curl
func (*Examples) CustomerCreated ¶
CustomerCreated creates a new customer
func (*Examples) CustomerDeleted ¶ added in v0.6.8
CustomerDeleted creates a customer, then deletes it
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) CustomerSubscriptionDeleted ¶ added in v0.6.8
CustomerSubscriptionDeleted creates a customer with a card, creates a plan, adds the customer to the plan, then deletes it
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) InvoicePaymentFailed ¶ added in v0.6.8
InvoicePaymentFailed first creates a customer, adds an invoice item, creates the invoice, and then fails the payment
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) ResendEvent ¶ added in v0.6.7
ResendEvent resends a webhook event using it's event-id "evt_<id>"
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)
AppendData appends data to the request parameters.
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