stripe-go: github.com/stripe/stripe-go Index | Examples | Files | Directories

package stripe

import "github.com/stripe/stripe-go"

Package stripe provides the binding for Stripe REST APIs.

Index

Examples

Package Files

account.go accountlink.go address.go applepaydomain.go application.go balance.go balancetransaction.go bankaccount.go bitcoinreceiver.go bitcointransaction.go capability.go card.go charge.go checkout_session.go countryspec.go coupon.go creditnote.go currency.go customer.go customerbalancetransaction.go discount.go dispute.go ephemeralkey.go error.go event.go exchangerate.go fee.go feerefund.go file.go filelink.go invoice.go invoiceitem.go issuing_authorization.go issuing_card.go issuing_cardholder.go issuing_dispute.go issuing_transaction.go iter.go log.go loginlink.go mandate.go oauth.go order.go orderreturn.go params.go paymentintent.go paymentmethod.go paymentsource.go payout.go person.go plan.go product.go radar_earlyfraudwarning.go radar_valuelist.go radar_valuelistitem.go recipient.go recipienttransfer.go refund.go reporting_reportrun.go reporting_reporttype.go reversal.go review.go setupintent.go sigma_scheduledqueryrun.go sku.go source.go sourcetransaction.go stripe.go sub.go subitem.go subschedule.go taxid.go taxrate.go terminal_connectiontoken.go terminal_location.go terminal_reader.go threedsecure.go token.go topup.go transfer.go usagerecord.go usagerecordsummary.go webhookendpoint.go

Constants

const (
    EndingBefore  = "ending_before"
    StartingAfter = "starting_after"
)

Contains constants for the names of parameters used for pagination in list APIs.

const (
    // APIVersion is the currently supported API version
    APIVersion string = "2019-11-05"

    // APIBackend is a constant representing the API service backend.
    APIBackend SupportedBackend = "api"

    // APIURL is the URL of the API service backend.
    APIURL string = "https://api.stripe.com"

    // ConnectURL is the URL for OAuth.
    ConnectURL string = "https://connect.stripe.com"

    // ConnectBackend is a constant representing the connect service backend for
    // OAuth.
    ConnectBackend SupportedBackend = "connect"

    // UnknownPlatform is the string returned as the system name if we couldn't get
    // one from `uname`.
    UnknownPlatform string = "unknown platform"

    // UploadsBackend is a constant representing the uploads service backend.
    UploadsBackend SupportedBackend = "uploads"

    // UploadsURL is the URL of the uploads service backend.
    UploadsURL string = "https://files.stripe.com"
)
const (
    UsageRecordActionIncrement string = "increment"
    UsageRecordActionSet       string = "set"
)

Possible values for the action parameter on usage record creation.

Variables

var EnableTelemetry = true

EnableTelemetry is a global override for enabling client telemetry, which sends request performance metrics to Stripe via the `X-Stripe-Client-Telemetry` header. If set to true, all clients will send telemetry metrics. Defaults to true.

Telemetry can also be disabled on a per-client basis by instead creating a `BackendConfig` with `EnableTelemetry: false`.

var Key string

Key is the Stripe API key used globally in the binding.

var LogLevel = 2

LogLevel is the logging level for this library. 0: no logging 1: errors only 2: errors + informational (default) 3: errors + informational + debug

Deprecated: Logging should be configured with DefaultLeveledLogger instead.

func Bool Uses

func Bool(v bool) *bool

Bool returns a pointer to the bool value passed in.

func BoolSlice Uses

func BoolSlice(v []bool) []*bool

BoolSlice returns a slice of bool pointers given a slice of bools.

func BoolValue Uses

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func Float64 Uses

func Float64(v float64) *float64

Float64 returns a pointer to the float64 value passed in.

func Float64Slice Uses

func Float64Slice(v []float64) []*float64

Float64Slice returns a slice of float64 pointers given a slice of float64s.

func Float64Value Uses

func Float64Value(v *float64) float64

Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.

func FormatURLPath Uses

func FormatURLPath(format string, params ...string) string

FormatURLPath takes a format string (of the kind used in the fmt package) representing a URL path with a number of parameters that belong in the path and returns a formatted string.

This is mostly a pass through to Sprintf. It exists to make it it impossible to accidentally provide a parameter type that would be formatted improperly; for example, a string pointer instead of a string.

It also URL-escapes every given parameter. This usually isn't necessary for a standard Stripe ID, but is needed in places where user-provided IDs are allowed, like in coupons or plans. We apply it broadly for extra safety.

func Int64 Uses

func Int64(v int64) *int64

Int64 returns a pointer to the int64 value passed in.

func Int64Slice Uses

func Int64Slice(v []int64) []*int64

Int64Slice returns a slice of int64 pointers given a slice of int64s.

func Int64Value Uses

func Int64Value(v *int64) int64

Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.

func NewIdempotencyKey Uses

func NewIdempotencyKey() string

NewIdempotencyKey generates a new idempotency key that can be used on a request.

func ParseID Uses

func ParseID(data []byte) (string, bool)

ParseID attempts to parse a string scalar from a given JSON value which is still encoded as []byte. If the value was a string, it returns the string along with true as the second return value. If not, false is returned as the second return value.

The purpose of this function is to detect whether a given value in a response from the Stripe API is a string ID or an expanded object.

func SetAppInfo Uses

func SetAppInfo(info *AppInfo)

SetAppInfo sets app information. See AppInfo.

func SetBackend Uses

func SetBackend(backend SupportedBackend, b Backend)

SetBackend sets the backend used in the binding.

func SetHTTPClient Uses

func SetHTTPClient(client *http.Client)

SetHTTPClient overrides the default HTTP client. This is useful if you're running in a Google AppEngine environment where the http.DefaultClient is not available.

func String Uses

func String(v string) *string

String returns a pointer to the string value passed in.

func StringSlice Uses

func StringSlice(v []string) []*string

StringSlice returns a slice of string pointers given a slice of strings.

func StringValue Uses

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

type APIConnectionError Uses

type APIConnectionError struct {
    // contains filtered or unexported fields
}

APIConnectionError is a failure to connect to the Stripe API.

func (*APIConnectionError) Error Uses

func (e *APIConnectionError) Error() string

Error serializes the error object to JSON and returns it as a string.

type APIError Uses

type APIError struct {
    // contains filtered or unexported fields
}

APIError is a catch all for any errors not covered by other types (and should be extremely uncommon).

func (*APIError) Error Uses

func (e *APIError) Error() string

Error serializes the error object to JSON and returns it as a string.

type Account Uses

type Account struct {
    BusinessProfile  *AccountBusinessProfile `json:"business_profile"`
    BusinessType     AccountBusinessType     `json:"business_type"`
    Capabilities     *AccountCapabilities    `json:"capabilities"`
    ChargesEnabled   bool                    `json:"charges_enabled"`
    Company          *AccountCompany         `json:"company"`
    Country          string                  `json:"country"`
    Created          int64                   `json:"created"`
    DefaultCurrency  Currency                `json:"default_currency"`
    Deleted          bool                    `json:"deleted"`
    DetailsSubmitted bool                    `json:"details_submitted"`
    Email            string                  `json:"email"`
    ExternalAccounts *ExternalAccountList    `json:"external_accounts"`
    ID               string                  `json:"id"`
    Individual       *Person                 `json:"individual"`
    Metadata         map[string]string       `json:"metadata"`
    Object           string                  `json:"object"`
    PayoutsEnabled   bool                    `json:"payouts_enabled"`
    Requirements     *AccountRequirements    `json:"requirements"`
    Settings         *AccountSettings        `json:"settings"`
    TOSAcceptance    *AccountTOSAcceptance   `json:"tos_acceptance"`
    Type             AccountType             `json:"type"`
}

Account is the resource representing your Stripe account. For more details see https://stripe.com/docs/api/#account.

func (*Account) UnmarshalJSON Uses

func (a *Account) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an account. This custom unmarshaling is needed because the resulting property may be an ID or the full struct if it was expanded.

type AccountAddress Uses

type AccountAddress struct {
    City       string `json:"city"`
    Country    string `json:"country"`
    Line1      string `json:"line1"`
    Line2      string `json:"line2"`
    PostalCode string `json:"postal_code"`
    State      string `json:"state"`

    // Town/cho-me. Note that this is only used for Kana/Kanji representations
    // of an address.
    Town string `json:"town"`
}

AccountAddress is the structure for an account address.

type AccountAddressParams Uses

type AccountAddressParams struct {
    City       *string `form:"city"`
    Country    *string `form:"country"`
    Line1      *string `form:"line1"`
    Line2      *string `form:"line2"`
    PostalCode *string `form:"postal_code"`
    State      *string `form:"state"`

    // Town/cho-me. Note that this is only used for Kana/Kanji representations
    // of an address.
    Town *string `form:"town"`
}

AccountAddressParams represents an address during account creation/updates.

type AccountBusinessProfile Uses

type AccountBusinessProfile struct {
    MCC                string   `json:"mcc"`
    Name               string   `json:"name"`
    ProductDescription string   `json:"product_description"`
    SupportAddress     *Address `json:"support_address"`
    SupportEmail       string   `json:"support_email"`
    SupportPhone       string   `json:"support_phone"`
    SupportURL         string   `json:"support_url"`
    URL                string   `json:"url"`
}

AccountBusinessProfile represents optional information related to the business.

type AccountBusinessProfileParams Uses

type AccountBusinessProfileParams struct {
    MCC                *string `form:"mcc"`
    Name               *string `form:"name"`
    ProductDescription *string `form:"product_description"`
    SupportEmail       *string `form:"support_email"`
    SupportPhone       *string `form:"support_phone"`
    SupportURL         *string `form:"support_url"`
    URL                *string `form:"url"`
}

AccountBusinessProfileParams are the parameters allowed for an account's business information

type AccountBusinessType Uses

type AccountBusinessType string

AccountBusinessType describes the business type associated with an account.

const (
    AccountBusinessTypeCompany    AccountBusinessType = "company"
    AccountBusinessTypeIndividual AccountBusinessType = "individual"
)

List of values that AccountBusinessType can take.

type AccountCapabilities Uses

type AccountCapabilities struct {
    CardPayments   AccountCapabilityStatus `json:"card_payments"`
    LegacyPayments AccountCapabilityStatus `json:"legacy_payments"`
    Transfers      AccountCapabilityStatus `json:"transfers"`
}

AccountCapabilities is the resource representing the capabilities enabled on that account.

type AccountCapability Uses

type AccountCapability string

AccountCapability maps to a given capability for an account.

const (
    AccountCapabilityCardPayments   AccountCapability = "card_payments"
    AccountCapabilityLegacyPayments AccountCapability = "legacy_payments"
    AccountCapabilityTransfers      AccountCapability = "transfers"
)

List of values that AccountCapability can take.

type AccountCapabilityStatus Uses

type AccountCapabilityStatus string

AccountCapabilityStatus is the status a given capability can have

const (
    AccountCapabilityStatusActive   AccountCapabilityStatus = "active"
    AccountCapabilityStatusInactive AccountCapabilityStatus = "inactive"
    AccountCapabilityStatusPending  AccountCapabilityStatus = "pending"
)

List of values that AccountCapabilityStatus can take.

type AccountCompany Uses

type AccountCompany struct {
    Address           *AccountAddress             `json:"address"`
    AddressKana       *AccountAddress             `json:"address_kana"`
    AddressKanji      *AccountAddress             `json:"address_kanji"`
    DirectorsProvided bool                        `json:"directors_provided"`
    Name              string                      `json:"name"`
    NameKana          string                      `json:"name_kana"`
    NameKanji         string                      `json:"name_kanji"`
    OwnersProvided    bool                        `json:"owners_provided"`
    Phone             string                      `json:"phone"`
    TaxIDProvided     bool                        `json:"tax_id_provided"`
    TaxIDRegistrar    string                      `json:"tax_id_registrar"`
    VATIDProvided     bool                        `json:"vat_id_provided"`
    Verification      *AccountCompanyVerification `json:"verification"`
}

AccountCompany represents details about the company or business associated with the account.

type AccountCompanyParams Uses

type AccountCompanyParams struct {
    Address           *AccountAddressParams             `form:"address"`
    AddressKana       *AccountAddressParams             `form:"address_kana"`
    AddressKanji      *AccountAddressParams             `form:"address_kanji"`
    DirectorsProvided *bool                             `form:"directors_provided"`
    Name              *string                           `form:"name"`
    NameKana          *string                           `form:"name_kana"`
    NameKanji         *string                           `form:"name_kanji"`
    OwnersProvided    *bool                             `form:"owners_provided"`
    Phone             *string                           `form:"phone"`
    TaxID             *string                           `form:"tax_id"`
    TaxIDRegistrar    *string                           `form:"tax_id_registrar"`
    VATID             *string                           `form:"vat_id"`
    Verification      *AccountCompanyVerificationParams `form:"verification"`
}

AccountCompanyParams are the parameters describing the company associated with the account.

type AccountCompanyVerification Uses

type AccountCompanyVerification struct {
    Document *AccountCompanyVerificationDocument `json:"document"`
}

AccountCompanyVerification represents details about a company's verification state.

type AccountCompanyVerificationDocument Uses

type AccountCompanyVerificationDocument struct {
    Back        *File                                         `json:"back"`
    Details     string                                        `json:"details"`
    DetailsCode AccountCompanyVerificationDocumentDetailsCode `json:"details_code"`
    Front       *File                                         `json:"front"`
}

AccountCompanyVerificationDocument represents details about a company's verification state.

type AccountCompanyVerificationDocumentDetailsCode Uses

type AccountCompanyVerificationDocumentDetailsCode string

AccountCompanyVerificationDocumentDetailsCode is a machine-readable code specifying the verification state of a document associated with a company.

const (
    AccountCompanyVerificationDocumentDetailsCodeDocumentCorrupt        AccountCompanyVerificationDocumentDetailsCode = "document_corrupt"
    AccountCompanyVerificationDocumentDetailsCodeDocumentFailedCopy     AccountCompanyVerificationDocumentDetailsCode = "document_failed_copy"
    AccountCompanyVerificationDocumentDetailsCodeDocumentFailedOther    AccountCompanyVerificationDocumentDetailsCode = "document_failed_other"
    AccountCompanyVerificationDocumentDetailsCodeDocumentFailedTestMode AccountCompanyVerificationDocumentDetailsCode = "document_failed_test_mode"
    AccountCompanyVerificationDocumentDetailsCodeDocumentFraudulent     AccountCompanyVerificationDocumentDetailsCode = "document_fraudulent"
    AccountCompanyVerificationDocumentDetailsCodeDocumentInvalid        AccountCompanyVerificationDocumentDetailsCode = "document_invalid"
    AccountCompanyVerificationDocumentDetailsCodeDocumentManipulated    AccountCompanyVerificationDocumentDetailsCode = "document_manipulated"
    AccountCompanyVerificationDocumentDetailsCodeDocumentNotReadable    AccountCompanyVerificationDocumentDetailsCode = "document_not_readable"
    AccountCompanyVerificationDocumentDetailsCodeDocumentNotUploaded    AccountCompanyVerificationDocumentDetailsCode = "document_not_uploaded"
    AccountCompanyVerificationDocumentDetailsCodeDocumentTooLarge       AccountCompanyVerificationDocumentDetailsCode = "document_too_large"
)

List of values that AccountCompanyVerificationDocumentDetailsCode can take.

type AccountCompanyVerificationDocumentParams Uses

type AccountCompanyVerificationDocumentParams struct {
    Back  *string `form:"back"`
    Front *string `form:"front"`
}

AccountCompanyVerificationDocumentParams are the parameters allowed to pass for a document verifying a company.

type AccountCompanyVerificationParams Uses

type AccountCompanyVerificationParams struct {
    Document *AccountCompanyVerificationDocumentParams `form:"document"`
}

AccountCompanyVerificationParams are the parameters allowed to verify a company.

type AccountDeclineOn Uses

type AccountDeclineOn struct {
    AVSFailure bool `json:"avs_failure"`
    CVCFailure bool `json:"cvc_failure"`
}

AccountDeclineOn represents card charges decline behavior for that account.

type AccountDeclineSettingsParams Uses

type AccountDeclineSettingsParams struct {
    AVSFailure *bool `form:"avs_failure"`
    CVCFailure *bool `form:"cvc_failure"`
}

AccountDeclineSettingsParams represents the parameters allowed for configuring card declines on connected accounts.

type AccountExternalAccountParams Uses

type AccountExternalAccountParams struct {
    Params            `form:"*"`
    AccountNumber     *string `form:"account_number"`
    AccountHolderName *string `form:"account_holder_name"`
    AccountHolderType *string `form:"account_holder_type"`
    Country           *string `form:"country"`
    Currency          *string `form:"currency"`
    RoutingNumber     *string `form:"routing_number"`
    Token             *string `form:"token"`
}

AccountExternalAccountParams are the parameters allowed to reference an external account when creating an account. It should either have Token set or everything else.

func (*AccountExternalAccountParams) AppendTo Uses

func (p *AccountExternalAccountParams) AppendTo(body *form.Values, keyParts []string)

AppendTo implements custom encoding logic for AccountExternalAccountParams so that we can send the special required `object` field up along with the other specified parameters or the token value.

type AccountLink struct {
    Created   int64  `json:"created"`
    ExpiresAt int64  `json:"expires_at"`
    Object    string `json:"object"`
    URL       string `json:"url"`
}

AccountLink is the resource representing an account link. For more details see https://stripe.com/docs/api/#account_links.

type AccountLinkCollect Uses

type AccountLinkCollect string

AccountLinkCollect describes what information the platform wants to collect with the account link.

const (
    AccountLinkCollectCurrentlyDue  AccountLinkCollect = "currently_due"
    AccountLinkCollectEventuallyDue AccountLinkCollect = "eventually_due"
)

List of values that AccountLinkCollect can take.

type AccountLinkParams Uses

type AccountLinkParams struct {
    Params     `form:"*"`
    Account    *string `form:"account"`
    Collect    *string `form:"collect"`
    FailureURL *string `form:"failure_url"`
    SuccessURL *string `form:"success_url"`
    Type       *string `form:"type"`
}

AccountLinkParams are the parameters allowed during an account link creation.

type AccountLinkType Uses

type AccountLinkType string

AccountLinkType is the type of an account link.

const (
    AccountLinkTypeCustomAccountUpdate       AccountLinkType = "custom_account_update"
    AccountLinkTypeCustomAccountVerification AccountLinkType = "custom_account_verification"
)

List of values that AccountLinkType can take.

type AccountList Uses

type AccountList struct {
    ListMeta
    Data []*Account `json:"data"`
}

AccountList is a list of accounts as returned from a list endpoint.

type AccountListParams Uses

type AccountListParams struct {
    ListParams `form:"*"`
}

AccountListParams are the parameters allowed during account listing.

type AccountParams Uses

type AccountParams struct {
    Params                `form:"*"`
    AccountToken          *string                       `form:"account_token"`
    BusinessProfile       *AccountBusinessProfileParams `form:"business_profile"`
    BusinessType          *string                       `form:"business_type"`
    Company               *AccountCompanyParams         `form:"company"`
    Country               *string                       `form:"country"`
    DefaultCurrency       *string                       `form:"default_currency"`
    Email                 *string                       `form:"email"`
    ExternalAccount       *AccountExternalAccountParams `form:"external_account"`
    Individual            *PersonParams                 `form:"individual"`
    RequestedCapabilities []*string                     `form:"requested_capabilities"`
    Settings              *AccountSettingsParams        `form:"settings"`
    TOSAcceptance         *AccountTOSAcceptanceParams   `form:"tos_acceptance"`
    Type                  *string                       `form:"type"`
}

AccountParams are the parameters allowed during account creation/updates.

type AccountPayoutSchedule Uses

type AccountPayoutSchedule struct {
    DelayDays     int64          `json:"delay_days"`
    Interval      PayoutInterval `json:"interval"`
    MonthlyAnchor int64          `json:"monthly_anchor"`
    WeeklyAnchor  string         `json:"weekly_anchor"`
}

AccountPayoutSchedule is the structure for an account's payout schedule.

type AccountRejectParams Uses

type AccountRejectParams struct {
    Params `form:"*"`
    Reason *string `form:"reason"`
}

AccountRejectParams is the structure for the Reject function.

type AccountRejectReason Uses

type AccountRejectReason string

AccountRejectReason describes the valid reason to reject an account

const (
    AccountRejectReasonFraud          AccountRejectReason = "fraud"
    AccountRejectReasonOther          AccountRejectReason = "other"
    AccountRejectReasonTermsOfService AccountRejectReason = "terms_of_service"
)

List of values that AccountRejectReason can take.

type AccountRequirements Uses

type AccountRequirements struct {
    CurrentDeadline     int64                             `json:"current_deadline"`
    CurrentlyDue        []string                          `json:"currently_due"`
    DisabledReason      AccountRequirementsDisabledReason `json:"disabled_reason"`
    EventuallyDue       []string                          `json:"eventually_due"`
    PastDue             []string                          `json:"past_due"`
    PendingVerification []string                          `json:"pending_verification"`
}

AccountRequirements represents information that needs to be collected for an account.

type AccountRequirementsDisabledReason Uses

type AccountRequirementsDisabledReason string

AccountRequirementsDisabledReason describes why an account is disabled.

const (
    AccountRequirementsDisabledReasonFieldsNeeded           AccountRequirementsDisabledReason = "fields_needed"
    AccountRequirementsDisabledReasonListed                 AccountRequirementsDisabledReason = "listed"
    AccountRequirementsDisabledReasonOther                  AccountRequirementsDisabledReason = "other"
    AccountRequirementsDisabledReasonRejectedFraud          AccountRequirementsDisabledReason = "rejected.fraud"
    AccountRequirementsDisabledReasonRejectedListed         AccountRequirementsDisabledReason = "rejected.listed"
    AccountRequirementsDisabledReasonRejectedOther          AccountRequirementsDisabledReason = "rejected.other"
    AccountRequirementsDisabledReasonRejectedTermsOfService AccountRequirementsDisabledReason = "rejected.terms_of_service"
    AccountRequirementsDisabledReasonUnderReview            AccountRequirementsDisabledReason = "under_review"
)

List of values that AccountRequirementsDisabledReason can take.

type AccountSettings Uses

type AccountSettings struct {
    Branding     *AccountSettingsBranding     `json:"branding"`
    CardPayments *AccountSettingsCardPayments `json:"card_payments"`
    Dashboard    *AccountSettingsDashboard    `json:"dashboard"`
    Payments     *AccountSettingsPayments     `json:"payments"`
    Payouts      *AccountSettingsPayouts      `json:"payouts"`
}

AccountSettings represents options for customizing how the account functions within Stripe.

type AccountSettingsBranding Uses

type AccountSettingsBranding struct {
    Icon         *File  `json:"icon"`
             *File  `json:"logo"`
    PrimaryColor string `json:"primary_color"`
}

AccountSettingsBranding represents settings specific to the account's branding.

type AccountSettingsBrandingParams Uses

type AccountSettingsBrandingParams struct {
    Icon         *string `form:"icon"`
             *string `form:"logo"`
    PrimaryColor *string `form:"primary_color"`
}

AccountSettingsBrandingParams represent allowed parameters to configure settings specific to the account’s branding.

type AccountSettingsCardPayments Uses

type AccountSettingsCardPayments struct {
    DeclineOn                 *AccountDeclineOn `json:"decline_on"`
    StatementDescriptorPrefix string            `json:"statement_descriptor_prefix"`
}

AccountSettingsCardPayments represents settings specific to card charging on the account.

type AccountSettingsCardPaymentsParams Uses

type AccountSettingsCardPaymentsParams struct {
    DeclineOn                 *AccountDeclineSettingsParams `form:"decline_on"`
    StatementDescriptorPrefix *string                       `form:"statement_descriptor_prefix"`
}

AccountSettingsCardPaymentsParams represent allowed parameters to configure settings specific to card charging on the account.

type AccountSettingsDashboard Uses

type AccountSettingsDashboard struct {
    DisplayName string `json:"display_name"`
    Timezone    string `json:"timezone"`
}

AccountSettingsDashboard represents settings specific to the account's Dashboard.

type AccountSettingsDashboardParams Uses

type AccountSettingsDashboardParams struct {
    DisplayName *string `form:"display_name"`
    Timezone    *string `form:"timezone"`
}

AccountSettingsDashboardParams represent allowed parameters to configure settings for the account's Dashboard.

type AccountSettingsParams Uses

type AccountSettingsParams struct {
    Branding     *AccountSettingsBrandingParams     `form:"branding"`
    CardPayments *AccountSettingsCardPaymentsParams `form:"card_payments"`
    Dashboard    *AccountSettingsDashboardParams    `form:"dashboard"`
    Payments     *AccountSettingsPaymentsParams     `form:"payments"`
    Payouts      *AccountSettingsPayoutsParams      `form:"payouts"`
}

AccountSettingsParams are the parameters allowed for the account's settings.

type AccountSettingsPayments Uses

type AccountSettingsPayments struct {
    StatementDescriptor      string `json:"statement_descriptor"`
    StatementDescriptorKana  string `json:"statement_descriptor_kana"`
    StatementDescriptorKanji string `json:"statement_descriptor_kanji"`
}

AccountSettingsPayments represents settings that apply across payment methods for charging on the account.

type AccountSettingsPaymentsParams Uses

type AccountSettingsPaymentsParams struct {
    StatementDescriptor      *string `form:"statement_descriptor"`
    StatementDescriptorKana  *string `form:"statement_descriptor_kana"`
    StatementDescriptorKanji *string `form:"statement_descriptor_kanji"`
}

AccountSettingsPaymentsParams represent allowed parameters to configure settings across payment methods for charging on the account.

type AccountSettingsPayouts Uses

type AccountSettingsPayouts struct {
    DebitNegativeBalances bool                   `json:"debit_negative_balances"`
    Schedule              *AccountPayoutSchedule `json:"schedule"`
    StatementDescriptor   string                 `json:"statement_descriptor"`
}

AccountSettingsPayouts represents settings specific to the account’s payouts.

type AccountSettingsPayoutsParams Uses

type AccountSettingsPayoutsParams struct {
    DebitNegativeBalances *bool                 `form:"debit_negative_balances"`
    Schedule              *PayoutScheduleParams `form:"schedule"`
    StatementDescriptor   *string               `form:"statement_descriptor"`
}

AccountSettingsPayoutsParams represent allowed parameters to configure settings specific to the account’s payouts.

type AccountTOSAcceptance Uses

type AccountTOSAcceptance struct {
    Date      int64  `json:"date"`
    IP        string `json:"ip"`
    UserAgent string `json:"user_agent"`
}

AccountTOSAcceptance represents status of acceptance of our terms of services for the account.

type AccountTOSAcceptanceParams Uses

type AccountTOSAcceptanceParams struct {
    Date      *int64  `form:"date"`
    IP        *string `form:"ip"`
    UserAgent *string `form:"user_agent"`
}

AccountTOSAcceptanceParams represents tos_acceptance during account creation/updates.

type AccountType Uses

type AccountType string

AccountType is the type of an account.

const (
    AccountTypeCustom   AccountType = "custom"
    AccountTypeExpress  AccountType = "express"
    AccountTypeStandard AccountType = "standard"
)

List of values that AccountType can take.

type Address Uses

type Address struct {
    City       string `json:"city"`
    Country    string `json:"country"`
    Line1      string `json:"line1"`
    Line2      string `json:"line2"`
    PostalCode string `json:"postal_code"`
    State      string `json:"state"`
}

Address describes common properties for an Address hash.

type AddressParams Uses

type AddressParams struct {
    City       *string `form:"city"`
    Country    *string `form:"country"`
    Line1      *string `form:"line1"`
    Line2      *string `form:"line2"`
    PostalCode *string `form:"postal_code"`
    State      *string `form:"state"`
}

AddressParams describes the common parameters for an Address.

type Amount Uses

type Amount struct {
    Value    int64    `json:"amount"`
    Currency Currency `json:"currency"`
}

Amount is a structure wrapping an amount value and its currency.

type AppInfo Uses

type AppInfo struct {
    Name      string `json:"name"`
    PartnerID string `json:"partner_id"`
    URL       string `json:"url"`
    Version   string `json:"version"`
}

AppInfo contains information about the "app" which this integration belongs to. This should be reserved for plugins that wish to identify themselves with Stripe.

type ApplePayDomain Uses

type ApplePayDomain struct {
    Created    int64  `json:"created"`
    Deleted    bool   `json:"deleted"`
    DomainName string `json:"domain_name"`
    ID         string `json:"id"`
    Livemode   bool   `json:"livemode"`
}

ApplePayDomain is the resource representing a Stripe ApplePayDomain object

type ApplePayDomainList Uses

type ApplePayDomainList struct {
    ListMeta
    Data []*ApplePayDomain `json:"data"`
}

ApplePayDomainList is a list of ApplePayDomains as returned from a list endpoint.

type ApplePayDomainListParams Uses

type ApplePayDomainListParams struct {
    ListParams `form:"*"`
}

ApplePayDomainListParams are the parameters allowed during ApplePayDomain listing.

type ApplePayDomainParams Uses

type ApplePayDomainParams struct {
    Params     `form:"*"`
    DomainName *string `form:"domain_name"`
}

ApplePayDomainParams is the set of parameters that can be used when creating an ApplePayDomain object.

type Application Uses

type Application struct {
    ID   string `json:"id"`
    Name string `json:"name"`
}

Application describes the properties for an Application.

func (*Application) UnmarshalJSON Uses

func (a *Application) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an Application. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type ApplicationFee Uses

type ApplicationFee struct {
    Account                *Account            `json:"account"`
    Amount                 int64               `json:"amount"`
    AmountRefunded         int64               `json:"amount_refunded"`
    Application            string              `json:"application"`
    BalanceTransaction     *BalanceTransaction `json:"balance_transaction"`
    Charge                 *Charge             `json:"charge"`
    Created                int64               `json:"created"`
    Currency               Currency            `json:"currency"`
    ID                     string              `json:"id"`
    Livemode               bool                `json:"livemode"`
    OriginatingTransaction *Charge             `json:"originating_transaction"`
    Refunded               bool                `json:"refunded"`
    Refunds                *FeeRefundList      `json:"refunds"`
}

ApplicationFee is the resource representing a Stripe application fee. For more details see https://stripe.com/docs/api#application_fees.

func (*ApplicationFee) UnmarshalJSON Uses

func (f *ApplicationFee) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an ApplicationFee. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type ApplicationFeeList Uses

type ApplicationFeeList struct {
    ListMeta
    Data []*ApplicationFee `json:"data"`
}

ApplicationFeeList is a list of application fees as retrieved from a list endpoint.

type ApplicationFeeListParams Uses

type ApplicationFeeListParams struct {
    ListParams   `form:"*"`
    Charge       *string           `form:"charge"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
}

ApplicationFeeListParams is the set of parameters that can be used when listing application fees. For more details see https://stripe.com/docs/api#list_application_fees.

type ApplicationFeeParams Uses

type ApplicationFeeParams struct {
    Params `form:"*"`
}

ApplicationFeeParams is the set of parameters that can be used when refunding an application fee. For more details see https://stripe.com/docs/api#refund_application_fee.

type AuthenticationError Uses

type AuthenticationError struct {
    // contains filtered or unexported fields
}

AuthenticationError is a failure to properly authenticate during a request.

func (*AuthenticationError) Error Uses

func (e *AuthenticationError) Error() string

Error serializes the error object to JSON and returns it as a string.

type AuthorizationControlsParams Uses

type AuthorizationControlsParams struct {
    AllowedCategories []*string                                           `form:"allowed_categories"`
    BlockedCategories []*string                                           `form:"blocked_categories"`
    SpendingLimits    []*IssuingAuthorizationControlsSpendingLimitsParams `form:"spending_limits"`

    // The following parameters are considered deprecated and only apply to issuing cards
    MaxAmount    *int64 `form:"max_amount"`
    MaxApprovals *int64 `form:"max_approvals"`
}

AuthorizationControlsParams is the set of parameters that can be used for the shipping parameter.

type AuthorizeURLParams Uses

type AuthorizeURLParams struct {
    Params                `form:"*"`
    AlwaysPrompt          *bool                  `form:"always_prompt"`
    ClientID              *string                `form:"client_id"`
    RedirectURI           *string                `form:"redirect_uri"`
    ResponseType          *string                `form:"response_type"`
    Scope                 *string                `form:"scope"`
    State                 *string                `form:"state"`
    StripeLanding         *string                `form:"stripe_landing"`
    StripeUser            *OAuthStripeUserParams `form:"stripe_user"`
    SuggestedCapabilities []*string              `form:"suggested_capabilities"`

    // Express is not sent as a parameter, but is used to modify the authorize URL
    // path to use the express OAuth path.
    Express *bool `form:"-"`
}

AuthorizeURLParams for creating OAuth AuthorizeURLs.

type Backend Uses

type Backend interface {
    Call(method, path, key string, params ParamsContainer, v interface{}) error
    CallRaw(method, path, key string, body *form.Values, params *Params, v interface{}) error
    CallMultipart(method, path, key, boundary string, body *bytes.Buffer, params *Params, v interface{}) error
    SetMaxNetworkRetries(maxNetworkRetries int)
}

Backend is an interface for making calls against a Stripe service. This interface exists to enable mocking for during testing if needed.

func GetBackend Uses

func GetBackend(backendType SupportedBackend) Backend

GetBackend returns one of the library's supported backends based off of the given argument.

It returns an existing default backend if one's already been created.

func GetBackendWithConfig Uses

func GetBackendWithConfig(backendType SupportedBackend, config *BackendConfig) Backend

GetBackendWithConfig is the same as GetBackend except that it can be given a configuration struct that will configure certain aspects of the backend that's return.

type BackendConfig Uses

type BackendConfig struct {
    // EnableTelemetry allows request metrics (request id and duration) to be sent
    // to Stripe in subsequent requests via the `X-Stripe-Client-Telemetry` header.
    //
    // Defaults to false.
    EnableTelemetry bool

    // HTTPClient is an HTTP client instance to use when making API requests.
    //
    // If left unset, it'll be set to a default HTTP client for the package.
    HTTPClient *http.Client

    // LeveledLogger is the logger that the backend will use to log errors,
    // warnings, and informational messages.
    //
    // LeveledLoggerInterface is implemented by LeveledLogger, and one can be
    // initialized at the desired level of logging.  LeveledLoggerInterface
    // also provides out-of-the-box compatibility with a Logrus Logger, but may
    // require a thin shim for use with other logging libraries that use less
    // standard conventions like Zap.
    LeveledLogger LeveledLoggerInterface

    // LogLevel is the logging level of the library and defined by:
    //
    // 0: no logging
    // 1: errors only
    // 2: errors + informational (default)
    // 3: errors + informational + debug
    //
    // Defaults to 0 (no logging), so please make sure to set this if you want
    // to see logging output in your custom configuration.
    //
    // Deprecated: Logging should be configured with LeveledLogger instead.
    LogLevel int

    // Logger is where this backend will write its logs.
    //
    // If left unset, it'll be set to Logger.
    //
    // Deprecated: Logging should be configured with LeveledLogger instead.
    Logger Printfer

    // MaxNetworkRetries sets maximum number of times that the library will
    // retry requests that appear to have failed due to an intermittent
    // problem.
    //
    // Defaults to 0.
    MaxNetworkRetries int

    // URL is the base URL to use for API paths.
    //
    // If left empty, it'll be set to the default for the SupportedBackend.
    URL string
}

BackendConfig is used to configure a new Stripe backend.

type BackendImplementation Uses

type BackendImplementation struct {
    Type              SupportedBackend
    URL               string
    HTTPClient        *http.Client
    LeveledLogger     LeveledLoggerInterface
    MaxNetworkRetries int
    // contains filtered or unexported fields
}

BackendImplementation is the internal implementation for making HTTP calls to Stripe.

The public use of this struct is deprecated. It will be unexported in a future version.

func (*BackendImplementation) Call Uses

func (s *BackendImplementation) Call(method, path, key string, params ParamsContainer, v interface{}) error

Call is the Backend.Call implementation for invoking Stripe APIs.

func (*BackendImplementation) CallMultipart Uses

func (s *BackendImplementation) CallMultipart(method, path, key, boundary string, body *bytes.Buffer, params *Params, v interface{}) error

CallMultipart is the Backend.CallMultipart implementation for invoking Stripe APIs.

func (*BackendImplementation) CallRaw Uses

func (s *BackendImplementation) CallRaw(method, path, key string, form *form.Values, params *Params, v interface{}) error

CallRaw is the implementation for invoking Stripe APIs internally without a backend.

func (*BackendImplementation) Do Uses

func (s *BackendImplementation) Do(req *http.Request, body *bytes.Buffer, v interface{}) error

Do is used by Call to execute an API request and parse the response. It uses the backend's HTTP client to execute the request and unmarshals the response into v. It also handles unmarshaling errors returned by the API.

func (*BackendImplementation) NewRequest Uses

func (s *BackendImplementation) NewRequest(method, path, key, contentType string, params *Params) (*http.Request, error)

NewRequest is used by Call to generate an http.Request. It handles encoding parameters and attaching the appropriate headers.

func (*BackendImplementation) ResponseToError Uses

func (s *BackendImplementation) ResponseToError(res *http.Response, resBody []byte) error

ResponseToError converts a stripe response to an Error.

func (*BackendImplementation) SetMaxNetworkRetries Uses

func (s *BackendImplementation) SetMaxNetworkRetries(maxNetworkRetries int)

SetMaxNetworkRetries sets max number of retries on failed requests

This function is deprecated. Please use GetBackendWithConfig instead.

func (*BackendImplementation) SetNetworkRetriesSleep Uses

func (s *BackendImplementation) SetNetworkRetriesSleep(sleep bool)

SetNetworkRetriesSleep allows the normal sleep between network retries to be enabled or disabled.

This function is available for internal testing only and should never be used in production.

func (*BackendImplementation) UnmarshalJSONVerbose Uses

func (s *BackendImplementation) UnmarshalJSONVerbose(statusCode int, body []byte, v interface{}) error

UnmarshalJSONVerbose unmarshals JSON, but in case of a failure logs and produces a more descriptive error.

type Backends Uses

type Backends struct {
    API, Connect, Uploads Backend
    // contains filtered or unexported fields
}

Backends are the currently supported endpoints.

func NewBackends Uses

func NewBackends(httpClient *http.Client) *Backends

NewBackends creates a new set of backends with the given HTTP client. You should only need to use this for testing purposes or on App Engine.

type Balance Uses

type Balance struct {
    Available []*Amount `json:"available"`
    Livemode  bool      `json:"livemode"`
    Pending   []*Amount `json:"pending"`
}

Balance is the resource representing your Stripe balance. For more details see https://stripe.com/docs/api/#balance.

type BalanceParams Uses

type BalanceParams struct {
    Params `form:"*"`
}

BalanceParams is the set of parameters that can be used when retrieving a balance. For more details see https://stripe.com/docs/api#balance.

type BalanceTransaction Uses

type BalanceTransaction struct {
    Amount       int64                     `json:"amount"`
    AvailableOn  int64                     `json:"available_on"`
    Created      int64                     `json:"created"`
    Currency     Currency                  `json:"currency"`
    Description  string                    `json:"description"`
    ExchangeRate float64                   `json:"exchange_rate"`
    ID           string                    `json:"id"`
    Fee          int64                     `json:"fee"`
    FeeDetails   []*BalanceTransactionFee  `json:"fee_details"`
    Net          int64                     `json:"net"`
    Recipient    string                    `json:"recipient"`
    Source       *BalanceTransactionSource `json:"source"`
    Status       BalanceTransactionStatus  `json:"status"`
    Type         BalanceTransactionType    `json:"type"`
}

BalanceTransaction is the resource representing the balance transaction. For more details see https://stripe.com/docs/api/#balance.

func (*BalanceTransaction) UnmarshalJSON Uses

func (t *BalanceTransaction) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Transaction. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type BalanceTransactionFee Uses

type BalanceTransactionFee struct {
    Amount      int64    `json:"amount"`
    Application string   `json:"application"`
    Currency    Currency `json:"currency"`
    Description string   `json:"description"`
    Type        string   `json:"type"`
}

BalanceTransactionFee is a structure that breaks down the fees in a transaction.

type BalanceTransactionList Uses

type BalanceTransactionList struct {
    ListMeta
    Data []*BalanceTransaction `json:"data"`
}

BalanceTransactionList is a list of transactions as returned from a list endpoint.

type BalanceTransactionListParams Uses

type BalanceTransactionListParams struct {
    ListParams       `form:"*"`
    AvailableOn      *int64            `form:"available_on"`
    AvailableOnRange *RangeQueryParams `form:"available_on"`
    Created          *int64            `form:"created"`
    CreatedRange     *RangeQueryParams `form:"created"`
    Currency         *string           `form:"currency"`
    Payout           *string           `form:"payout"`
    Source           *string           `form:"source"`
    Type             *string           `form:"type"`
}

BalanceTransactionListParams is the set of parameters that can be used when listing balance transactions. For more details see https://stripe.com/docs/api/#balance_history.

type BalanceTransactionParams Uses

type BalanceTransactionParams struct {
    Params `form:"*"`
}

BalanceTransactionParams is the set of parameters that can be used when retrieving a transaction. For more details see https://stripe.com/docs/api#retrieve_balance_transaction.

type BalanceTransactionSource Uses

type BalanceTransactionSource struct {
    ApplicationFee       *ApplicationFee              `json:"-"`
    Charge               *Charge                      `json:"-"`
    Dispute              *Dispute                     `json:"-"`
    ID                   string                       `json:"id"`
    IssuingAuthorization *IssuingAuthorization        `json:"-"`
    IssuingTransaction   *IssuingAuthorization        `json:"-"`
    Payout               *Payout                      `json:"-"`
    RecipientTransfer    *RecipientTransfer           `json:"-"`
    Refund               *Refund                      `json:"-"`
    Reversal             *Reversal                    `json:"-"`
    Transfer             *Transfer                    `json:"-"`
    Type                 BalanceTransactionSourceType `json:"object"`
}

BalanceTransactionSource describes the source of a balance Transaction. The Type should indicate which object is fleshed out. For more details see https://stripe.com/docs/api#retrieve_balance_transaction

func (*BalanceTransactionSource) UnmarshalJSON Uses

func (s *BalanceTransactionSource) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a BalanceTransactionSource. This custom unmarshaling is needed because the specific type of transaction source it refers to is specified in the JSON

type BalanceTransactionSourceType Uses

type BalanceTransactionSourceType string

BalanceTransactionSourceType consts represent valid balance transaction sources.

const (
    BalanceTransactionSourceTypeApplicationFee       BalanceTransactionSourceType = "application_fee"
    BalanceTransactionSourceTypeCharge               BalanceTransactionSourceType = "charge"
    BalanceTransactionSourceTypeDispute              BalanceTransactionSourceType = "dispute"
    BalanceTransactionSourceTypeIssuingAuthorization BalanceTransactionSourceType = "issuing.authorization"
    BalanceTransactionSourceTypeIssuingTransaction   BalanceTransactionSourceType = "issuing.transaction"
    BalanceTransactionSourceTypePayout               BalanceTransactionSourceType = "payout"
    BalanceTransactionSourceTypeRecipientTransfer    BalanceTransactionSourceType = "recipient_transfer"
    BalanceTransactionSourceTypeRefund               BalanceTransactionSourceType = "refund"
    BalanceTransactionSourceTypeReversal             BalanceTransactionSourceType = "reversal"
    BalanceTransactionSourceTypeTransfer             BalanceTransactionSourceType = "transfer"
)

List of values that BalanceTransactionSourceType can take.

type BalanceTransactionStatus Uses

type BalanceTransactionStatus string

BalanceTransactionStatus is the list of allowed values for the balance transaction's status.

const (
    BalanceTransactionStatusAvailable BalanceTransactionStatus = "available"
    BalanceTransactionStatusPending   BalanceTransactionStatus = "pending"
)

List of values that BalanceTransactionStatus can take.

type BalanceTransactionType Uses

type BalanceTransactionType string

BalanceTransactionType is the list of allowed values for the balance transaction's type.

const (
    BalanceTransactionTypeAdjustment                      BalanceTransactionType = "adjustment"
    BalanceTransactionTypeApplicationFee                  BalanceTransactionType = "application_fee"
    BalanceTransactionTypeApplicationFeeRefund            BalanceTransactionType = "application_fee_refund"
    BalanceTransactionTypeCharge                          BalanceTransactionType = "charge"
    BalanceTransactionTypeIssuingAuthorizationHold        BalanceTransactionType = "issuing_authorization_hold"
    BalanceTransactionTypeIssuingAuthorizationRelease     BalanceTransactionType = "issuing_authorization_release"
    BalanceTransactionTypeIssuingAuthorizationTransaction BalanceTransactionType = "issuing_transaction"
    BalanceTransactionTypePayment                         BalanceTransactionType = "payment"
    BalanceTransactionTypePaymentFailureRefund            BalanceTransactionType = "payment_failure_refund"
    BalanceTransactionTypePaymentRefund                   BalanceTransactionType = "payment_refund"
    BalanceTransactionTypePayout                          BalanceTransactionType = "payout"
    BalanceTransactionTypePayoutCancel                    BalanceTransactionType = "payout_cancel"
    BalanceTransactionTypePayoutFailure                   BalanceTransactionType = "payout_failure"
    BalanceTransactionTypeRecipientTransfer               BalanceTransactionType = "recipient_transfer"
    BalanceTransactionTypeRecipientTransferCancel         BalanceTransactionType = "recipient_transfer_cancel"
    BalanceTransactionTypeRecipientTransferFailure        BalanceTransactionType = "recipient_transfer_failure"
    BalanceTransactionTypeRefund                          BalanceTransactionType = "refund"
    BalanceTransactionTypeStripeFee                       BalanceTransactionType = "stripe_fee"
    BalanceTransactionTypeTransfer                        BalanceTransactionType = "transfer"
    BalanceTransactionTypeTransferRefund                  BalanceTransactionType = "transfer_refund"
)

List of values that BalanceTransactionType can take.

type BankAccount Uses

type BankAccount struct {
    Account            *Account                     `json:"account"`
    AccountHolderName  string                       `json:"account_holder_name"`
    AccountHolderType  BankAccountAccountHolderType `json:"account_holder_type"`
    BankName           string                       `json:"bank_name"`
    Country            string                       `json:"country"`
    Currency           Currency                     `json:"currency"`
    Customer           *Customer                    `json:"customer"`
    DefaultForCurrency bool                         `json:"default_for_currency"`
    Deleted            bool                         `json:"deleted"`
    Fingerprint        string                       `json:"fingerprint"`
    ID                 string                       `json:"id"`
    Last4              string                       `json:"last4"`
    Metadata           map[string]string            `json:"metadata"`
    RoutingNumber      string                       `json:"routing_number"`
    Status             BankAccountStatus            `json:"status"`
}

BankAccount represents a Stripe bank account.

func (*BankAccount) UnmarshalJSON Uses

func (b *BankAccount) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a BankAccount. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type BankAccountAccountHolderType Uses

type BankAccountAccountHolderType string

BankAccountAccountHolderType is the list of allowed values for the bank account holder type.

const (
    BankAccountAccountHolderTypeCompany    BankAccountAccountHolderType = "company"
    BankAccountAccountHolderTypeIndividual BankAccountAccountHolderType = "individual"
)

List of values that BankAccountAccountHolderType can take.

type BankAccountList Uses

type BankAccountList struct {
    ListMeta
    Data []*BankAccount `json:"data"`
}

BankAccountList is a list object for bank accounts.

type BankAccountListParams Uses

type BankAccountListParams struct {
    ListParams `form:"*"`

    // The identifier of the parent account under which the bank accounts are
    // nested. Either Account or Customer should be populated.
    Account *string `form:"-"`

    // The identifier of the parent customer under which the bank accounts are
    // nested. Either Account or Customer should be populated.
    Customer *string `form:"-"`
}

BankAccountListParams is the set of parameters that can be used when listing bank accounts.

func (*BankAccountListParams) AppendTo Uses

func (p *BankAccountListParams) AppendTo(body *form.Values, keyParts []string)

AppendTo implements custom encoding logic for BankAccountListParams so that we can send the special required `object` field up along with the other specified parameters.

type BankAccountParams Uses

type BankAccountParams struct {
    Params `form:"*"`

    // Account is the identifier of the parent account under which bank
    // accounts are nested.
    Account *string `form:"-"`

    AccountHolderName  *string `form:"account_holder_name"`
    AccountHolderType  *string `form:"account_holder_type"`
    AccountNumber      *string `form:"account_number"`
    Country            *string `form:"country"`
    Currency           *string `form:"currency"`
    Customer           *string `form:"-"`
    DefaultForCurrency *bool   `form:"default_for_currency"`
    RoutingNumber      *string `form:"routing_number"`

    // Token is a token referencing an external account like one returned from
    // Stripe.js.
    Token *string `form:"-"`

    // ID is used when tokenizing a bank account for shared customers
    ID  *string `form:"*"`
}

BankAccountParams is the set of parameters that can be used when updating a bank account.

Note that while form annotations are used for updates, bank accounts have some unusual logic on creates that necessitates manual handling of all parameters. See AppendToAsSourceOrExternalAccount.

func (*BankAccountParams) AppendToAsSourceOrExternalAccount Uses

func (a *BankAccountParams) AppendToAsSourceOrExternalAccount(body *form.Values)

AppendToAsSourceOrExternalAccount appends the given BankAccountParams as either a source or external account.

It may look like an AppendTo from the form package, but it's not, and is only used in the special case where we use `bankaccount.New`. It's needed because we have some weird encoding logic here that can't be handled by the form package (and it's special enough that it wouldn't be desirable to have it do so).

This is not a pattern that we want to push forward, and this largely exists because the bank accounts endpoint is a little unusual. There is one other resource like it, which is cards.

type BankAccountStatus Uses

type BankAccountStatus string

BankAccountStatus is the list of allowed values for the bank account's status.

const (
    BankAccountStatusErrored            BankAccountStatus = "errored"
    BankAccountStatusNew                BankAccountStatus = "new"
    BankAccountStatusValidated          BankAccountStatus = "validated"
    BankAccountStatusVerificationFailed BankAccountStatus = "verification_failed"
    BankAccountStatusVerified           BankAccountStatus = "verified"
)

List of values that BankAccountStatus can take.

type BillingDetails Uses

type BillingDetails struct {
    Address *Address `json:"address"`
    Email   string   `json:"email"`
    Name    string   `json:"name"`
    Phone   string   `json:"phone"`
}

BillingDetails represents the billing details associated with a PaymentMethod.

type BillingDetailsParams Uses

type BillingDetailsParams struct {
    Address *AddressParams `form:"address"`
    Email   *string        `form:"email"`
    Name    *string        `form:"name"`
    Phone   *string        `form:"phone"`
}

BillingDetailsParams is the set of parameters that can be used as billing details when creating or updating a PaymentMethod

type BitcoinReceiver Uses

type BitcoinReceiver struct {
    Active                bool                    `json:"active"`
    Amount                int64                   `json:"amount"`
    AmountReceived        int64                   `json:"amount_received"`
    BitcoinAmount         int64                   `json:"bitcoin_amount"`
    BitcoinAmountReceived int64                   `json:"bitcoin_amount_received"`
    BitcoinURI            string                  `json:"bitcoin_uri"`
    Created               int64                   `json:"created"`
    Currency              Currency                `json:"currency"`
    Customer              string                  `json:"customer"`
    Description           string                  `json:"description"`
    Email                 string                  `json:"email"`
    Filled                bool                    `json:"filled"`
    ID                    string                  `json:"id"`
    InboundAddress        string                  `json:"inbound_address"`
    Metadata              map[string]string       `json:"metadata"`
    Payment               string                  `json:"payment"`
    RefundAddress         string                  `json:"refund_address"`
    RejectTransactions    bool                    `json:"reject_transactions"`
    Transactions          *BitcoinTransactionList `json:"transactions"`
}

BitcoinReceiver is the resource representing a Stripe bitcoin receiver. For more details see https://stripe.com/docs/api/#bitcoin_receivers

func (*BitcoinReceiver) UnmarshalJSON Uses

func (r *BitcoinReceiver) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a BitcoinReceiver. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type BitcoinReceiverList Uses

type BitcoinReceiverList struct {
    ListMeta
    Data []*BitcoinReceiver `json:"data"`
}

BitcoinReceiverList is a list of bitcoin receivers as retrieved from a list endpoint.

type BitcoinReceiverListParams Uses

type BitcoinReceiverListParams struct {
    ListParams      `form:"*"`
    Active          *bool `form:"active"`
    Filled          *bool `form:"filled"`
    UncapturedFunds *bool `form:"uncaptured_funds"`
}

BitcoinReceiverListParams is the set of parameters that can be used when listing BitcoinReceivers. For more details see https://stripe.com/docs/api/#list_bitcoin_receivers.

type BitcoinTransaction Uses

type BitcoinTransaction struct {
    Amount        int64    `json:"amount"`
    BitcoinAmount int64    `json:"bitcoin_amount"`
    Created       int64    `json:"created"`
    Currency      Currency `json:"currency"`
    Customer      string   `json:"customer"`
    ID            string   `json:"id"`
    Receiver      string   `json:"receiver"`
}

BitcoinTransaction is the resource representing a Stripe bitcoin transaction. For more details see https://stripe.com/docs/api/#bitcoin_receivers

func (*BitcoinTransaction) UnmarshalJSON Uses

func (bt *BitcoinTransaction) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a BitcoinTransaction. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type BitcoinTransactionList Uses

type BitcoinTransactionList struct {
    ListMeta
    Data []*BitcoinTransaction `json:"data"`
}

BitcoinTransactionList is a list object for BitcoinTransactions. It is a child object of BitcoinRecievers For more details see https://stripe.com/docs/api/#retrieve_bitcoin_receiver

type BitcoinTransactionListParams Uses

type BitcoinTransactionListParams struct {
    ListParams `form:"*"`
    Customer   *string `form:"customer"`
    Receiver   *string `form:"-"` // Sent in with the URL
}

BitcoinTransactionListParams is the set of parameters that can be used when listing BitcoinTransactions.

type Capability Uses

type Capability struct {
    Account      *Account                `json:"account"`
    ID           string                  `json:"id"`
    Object       string                  `json:"object"`
    Requested    bool                    `json:"requested"`
    RequestedAt  int64                   `json:"requested_at"`
    Requirements *CapabilityRequirements `json:"requirements"`
    Status       CapabilityStatus        `json:"status"`
}

Capability is the resource representing a Stripe capability. For more details see https://stripe.com/docs/api/capabilities

func (*Capability) UnmarshalJSON Uses

func (c *Capability) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Capability. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CapabilityDisabledReason Uses

type CapabilityDisabledReason string

CapabilityDisabledReason describes why a capability is disabled.

const (
    CapabilityDisabledReasonPendingOnboarding        CapabilityDisabledReason = "pending.onboarding"
    CapabilityDisabledReasonPendingReview            CapabilityDisabledReason = "pending.review"
    CapabilityDisabledReasonRejectedFraud            CapabilityDisabledReason = "rejected_fraud"
    CapabilityDisabledReasonRejectedListed           CapabilityDisabledReason = "rejected.listed"
    CapabilityDisabledReasonRejectedOther            CapabilityDisabledReason = "rejected.other"
    CapabilityDisabledReasonRequirementsFieldsNeeded CapabilityDisabledReason = "requirement.fields_needed"
)

List of values that CapabilityDisabledReason can take.

type CapabilityList Uses

type CapabilityList struct {
    ListMeta
    Data []*Capability `json:"data"`
}

CapabilityList is a list of capabilities as retrieved from a list endpoint.

type CapabilityListParams Uses

type CapabilityListParams struct {
    ListParams `form:"*"`
    Account    *string `form:"-"` // Included in URL
}

CapabilityListParams is the set of parameters that can be used when listing capabilities. For more detail see https://stripe.com/docs/api/capabilities/list

type CapabilityParams Uses

type CapabilityParams struct {
    Params    `form:"*"`
    Account   *string `form:"-"` // Included in URL
    Requested *bool   `form:"requested"`
}

CapabilityParams is the set of parameters that can be used when updating a capability. For more details see https://stripe.com/docs/api/capabilities/update

type CapabilityRequirements Uses

type CapabilityRequirements struct {
    CurrentDeadline     int64                    `json:"current_deadline"`
    CurrentlyDue        []string                 `json:"currently_due"`
    DisabledReason      CapabilityDisabledReason `json:"disabled_reason"`
    EventuallyDue       []string                 `json:"eventually_due"`
    PastDue             []string                 `json:"past_due"`
    PendingVerification []string                 `json:"pending_verification"`
}

CapabilityRequirements represents information that needs to be collected for a capability.

type CapabilityStatus Uses

type CapabilityStatus string

CapabilityStatus describes the different statuses for a capability's status.

const (
    CapabilityStatusActive      CapabilityStatus = "active"
    CapabilityStatusInactive    CapabilityStatus = "inactive"
    CapabilityStatusPending     CapabilityStatus = "pending"
    CapabilityStatusUnrequested CapabilityStatus = "unrequested"
)

List of values that CapabilityStatus can take.

type CaptureParams Uses

type CaptureParams struct {
    Params                    `form:"*"`
    Amount                    *int64                    `form:"amount"`
    ApplicationFeeAmount      *int64                    `form:"application_fee_amount"`
    ExchangeRate              *float64                  `form:"exchange_rate"`
    ReceiptEmail              *string                   `form:"receipt_email"`
    StatementDescriptor       *string                   `form:"statement_descriptor"`
    StatementDescriptorSuffix *string                   `form:"statement_descriptor_suffix"`
    TransferGroup             *string                   `form:"transfer_group"`
    TransferData              *ChargeTransferDataParams `form:"transfer_data"`
}

CaptureParams is the set of parameters that can be used when capturing a charge.

type Card Uses

type Card struct {
    AddressCity            string                      `json:"address_city"`
    AddressCountry         string                      `json:"address_country"`
    AddressLine1           string                      `json:"address_line1"`
    AddressLine1Check      CardVerification            `json:"address_line1_check"`
    AddressLine2           string                      `json:"address_line2"`
    AddressState           string                      `json:"address_state"`
    AddressZip             string                      `json:"address_zip"`
    AddressZipCheck        CardVerification            `json:"address_zip_check"`
    AvailablePayoutMethods []CardAvailablePayoutMethod `json:"available_payout_methods"`
    Brand                  CardBrand                   `json:"brand"`
    CVCCheck               CardVerification            `json:"cvc_check"`
    Country                string                      `json:"country"`
    Currency               Currency                    `json:"currency"`
    Customer               *Customer                   `json:"customer"`
    DefaultForCurrency     bool                        `json:"default_for_currency"`
    Deleted                bool                        `json:"deleted"`

    // Description is a succinct summary of the card's information.
    //
    // Please note that this field is for internal use only and is not returned
    // as part of standard API requests.
    Description string `json:"description"`

    DynamicLast4 string      `json:"dynamic_last4"`
    ExpMonth     uint8       `json:"exp_month"`
    ExpYear      uint16      `json:"exp_year"`
    Fingerprint  string      `json:"fingerprint"`
    Funding      CardFunding `json:"funding"`
    ID           string      `json:"id"`

    // IIN is the card's "Issuer Identification Number".
    //
    // Please note that this field is for internal use only and is not returned
    // as part of standard API requests.
    IIN string `json:"iin"`

    // Issuer is a bank or financial institution that provides the card.
    //
    // Please note that this field is for internal use only and is not returned
    // as part of standard API requests.
    Issuer string `json:"issuer"`

    Last4              string                 `json:"last4"`
    Metadata           map[string]string      `json:"metadata"`
    Name               string                 `json:"name"`
    Recipient          *Recipient             `json:"recipient"`
    ThreeDSecure       *ThreeDSecure          `json:"three_d_secure"`
    TokenizationMethod CardTokenizationMethod `json:"tokenization_method"`
}

Card is the resource representing a Stripe credit/debit card. For more details see https://stripe.com/docs/api#cards.

func (*Card) UnmarshalJSON Uses

func (c *Card) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Card. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CardAvailablePayoutMethod Uses

type CardAvailablePayoutMethod string

CardAvailablePayoutMethod is a set of available payout methods for the card.

const (
    CardAvailablePayoutMethodInstant  CardAvailablePayoutMethod = "Instant"
    CardAvailablePayoutMethodStandard CardAvailablePayoutMethod = "Standard"
)

List of values that CardAvailablePayoutMethod can take.

type CardBrand Uses

type CardBrand string

CardBrand is the list of allowed values for the card's brand.

const (
    CardBrandAmex       CardBrand = "American Express"
    CardBrandDiscover   CardBrand = "Discover"
    CardBrandDinersClub CardBrand = "Diners Club"
    CardBrandJCB        CardBrand = "JCB"
    CardBrandMasterCard CardBrand = "MasterCard"
    CardBrandUnknown    CardBrand = "Unknown"
    CardBrandUnionPay   CardBrand = "UnionPay"
    CardBrandVisa       CardBrand = "Visa"
)

List of values that CardBrand can take.

type CardError Uses

type CardError struct {

    // DeclineCode is a code indicating a card issuer's reason for declining a
    // card (if they provided one).
    DeclineCode DeclineCode `json:"decline_code,omitempty"`
    // contains filtered or unexported fields
}

CardError are the most common type of error you should expect to handle. They result when the user enters a card that can't be charged for some reason.

func (*CardError) Error Uses

func (e *CardError) Error() string

Error serializes the error object to JSON and returns it as a string.

type CardFunding Uses

type CardFunding string

CardFunding is the list of allowed values for the card's funding.

const (
    CardFundingCredit  CardFunding = "credit"
    CardFundingDebit   CardFunding = "debit"
    CardFundingPrepaid CardFunding = "prepaid"
    CardFundingUnknown CardFunding = "unknown"
)

List of values that CardFunding can take.

type CardList Uses

type CardList struct {
    ListMeta
    Data []*Card `json:"data"`
}

CardList is a list object for cards.

type CardListParams Uses

type CardListParams struct {
    ListParams `form:"*"`
    Account    *string `form:"-"`
    Customer   *string `form:"-"`
    Recipient  *string `form:"-"`
}

CardListParams is the set of parameters that can be used when listing cards. For more details see https://stripe.com/docs/api#list_cards.

func (*CardListParams) AppendTo Uses

func (p *CardListParams) AppendTo(body *form.Values, keyParts []string)

AppendTo implements custom encoding logic for CardListParams so that we can send the special required `object` field up along with the other specified parameters.

type CardParams Uses

type CardParams struct {
    Params             `form:"*"`
    Account            *string `form:"-"`
    AddressCity        *string `form:"address_city"`
    AddressCountry     *string `form:"address_country"`
    AddressLine1       *string `form:"address_line1"`
    AddressLine2       *string `form:"address_line2"`
    AddressState       *string `form:"address_state"`
    AddressZip         *string `form:"address_zip"`
    CVC                *string `form:"cvc"`
    Currency           *string `form:"currency"`
    Customer           *string `form:"-"`
    DefaultForCurrency *bool   `form:"default_for_currency"`
    ExpMonth           *string `form:"exp_month"`
    ExpYear            *string `form:"exp_year"`
    Name               *string `form:"name"`
    Number             *string `form:"number"`
    Recipient          *string `form:"-"`
    Token              *string `form:"-"`

    // ID is used when tokenizing a card for shared customers
    ID  string `form:"*"`
}

CardParams is the set of parameters that can be used when creating or updating a card. For more details see https://stripe.com/docs/api#create_card and https://stripe.com/docs/api#update_card.

Note that while form annotations are used for tokenization and updates, cards have some unusual logic on creates that necessitates manual handling of all parameters. See AppendToAsCardSourceOrExternalAccount.

func (*CardParams) AppendToAsCardSourceOrExternalAccount Uses

func (c *CardParams) AppendToAsCardSourceOrExternalAccount(body *form.Values, keyParts []string)

AppendToAsCardSourceOrExternalAccount appends the given CardParams as either a card or external account.

It may look like an AppendTo from the form package, but it's not, and is only used in the special case where we use `card.New`. It's needed because we have some weird encoding logic here that can't be handled by the form package (and it's special enough that it wouldn't be desirable to have it do so).

This is not a pattern that we want to push forward, and this largely exists because the cards endpoint is a little unusual. There is one other resource like it, which is bank account.

type CardTokenizationMethod Uses

type CardTokenizationMethod string

CardTokenizationMethod is the list of allowed values for the card's tokenization method.

const (
    TokenizationMethodAndroidPay CardTokenizationMethod = "android_pay"
    TokenizationMethodApplePay   CardTokenizationMethod = "apple_pay"
)

List of values that CardTokenizationMethod can take.

type CardVerification Uses

type CardVerification string

CardVerification is the list of allowed verification responses.

const (
    CardVerificationFail        CardVerification = "fail"
    CardVerificationPass        CardVerification = "pass"
    CardVerificationUnavailable CardVerification = "unavailable"
    CardVerificationUnchecked   CardVerification = "unchecked"
)

List of values that CardVerification can take.

type Charge Uses

type Charge struct {
    Amount                    int64                       `json:"amount"`
    AmountRefunded            int64                       `json:"amount_refunded"`
    Application               *Application                `json:"application"`
    ApplicationFee            *ApplicationFee             `json:"application_fee"`
    ApplicationFeeAmount      int64                       `json:"application_fee_amount"`
    AuthorizationCode         string                      `json:"authorization_code"`
    BalanceTransaction        *BalanceTransaction         `json:"balance_transaction"`
    BillingDetails            *BillingDetails             `json:"billing_details"`
    Captured                  bool                        `json:"captured"`
    Created                   int64                       `json:"created"`
    Currency                  Currency                    `json:"currency"`
    Customer                  *Customer                   `json:"customer"`
    Description               string                      `json:"description"`
    Destination               *Account                    `json:"destination"`
    Dispute                   *Dispute                    `json:"dispute"`
    Disputed                  bool                        `json:"disputed"`
    FailureCode               string                      `json:"failure_code"`
    FailureMessage            string                      `json:"failure_message"`
    FraudDetails              *FraudDetails               `json:"fraud_details"`
    ID                        string                      `json:"id"`
    Invoice                   *Invoice                    `json:"invoice"`
    Level3                    ChargeLevel3                `json:"level3"`
    Livemode                  bool                        `json:"livemode"`
    Metadata                  map[string]string           `json:"metadata"`
    OnBehalfOf                *Account                    `json:"on_behalf_of"`
    Outcome                   *ChargeOutcome              `json:"outcome"`
    Paid                      bool                        `json:"paid"`
    PaymentIntent             string                      `json:"payment_intent"`
    PaymentMethod             string                      `json:"payment_method"`
    PaymentMethodDetails      *ChargePaymentMethodDetails `json:"payment_method_details"`
    ReceiptEmail              string                      `json:"receipt_email"`
    ReceiptNumber             string                      `json:"receipt_number"`
    ReceiptURL                string                      `json:"receipt_url"`
    Refunded                  bool                        `json:"refunded"`
    Refunds                   *RefundList                 `json:"refunds"`
    Review                    *Review                     `json:"review"`
    Shipping                  *ShippingDetails            `json:"shipping"`
    Source                    *PaymentSource              `json:"source"`
    SourceTransfer            *Transfer                   `json:"source_transfer"`
    StatementDescriptor       string                      `json:"statement_descriptor"`
    StatementDescriptorSuffix string                      `json:"statement_descriptor_suffix"`
    Status                    string                      `json:"status"`
    Transfer                  *Transfer                   `json:"transfer"`
    TransferData              *ChargeTransferData         `json:"transfer_data"`
    TransferGroup             string                      `json:"transfer_group"`
}

Charge is the resource representing a Stripe charge. For more details see https://stripe.com/docs/api#charges.

Code:

stripe.Key = "sk_key"

params := &stripe.ChargeParams{}
params.AddExpand("customer")
params.AddExpand("application")
params.AddExpand("balance_transaction")

ch, err := charge.Get("ch_example_id", params)

if err != nil {
    log.Fatal(err)
}

if ch.Application != nil {
    log.Fatal(err)
}

log.Printf("%v\n", ch.ID)

Code:

stripe.Key = "sk_key"

params := &stripe.ChargeParams{
    Amount:   stripe.Int64(1000),
    Currency: stripe.String(string(stripe.CurrencyUSD)),
}
params.SetSource("tok_visa")
params.AddMetadata("key", "value")

ch, err := charge.New(params)

if err != nil {
    log.Fatal(err)
}

log.Printf("%v\n", ch.ID)

func (*Charge) UnmarshalJSON Uses

func (c *Charge) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a charge. This custom unmarshaling is needed because the resulting property may be an ID or the full struct if it was expanded.

type ChargeFraudStripeReport Uses

type ChargeFraudStripeReport string

ChargeFraudStripeReport is the list of allowed values for reporting fraud.

const (
    ChargeFraudStripeReportFraudulent ChargeFraudStripeReport = "fraudulent"
)

List of values that ChargeFraudStripeReport can take.

type ChargeFraudUserReport Uses

type ChargeFraudUserReport string

ChargeFraudUserReport is the list of allowed values for reporting fraud.

const (
    ChargeFraudUserReportFraudulent ChargeFraudUserReport = "fraudulent"
    ChargeFraudUserReportSafe       ChargeFraudUserReport = "safe"
)

List of values that ChargeFraudUserReport can take.

type ChargeLevel3 Uses

type ChargeLevel3 struct {
    CustomerReference  string                  `json:"customer_reference"`
    LineItems          []*ChargeLevel3LineItem `json:"line_items"`
    MerchantReference  string                  `json:"merchant_reference"`
    ShippingAddressZip string                  `json:"shipping_address_zip"`
    ShippingFromZip    string                  `json:"shipping_from_zip"`
    ShippingAmount     int64                   `json:"shipping_amount"`
}

ChargeLevel3 represents the Level III data. This is in private beta and would be empty for most integrations

type ChargeLevel3LineItem Uses

type ChargeLevel3LineItem struct {
    DiscountAmount     int64  `json:"discount_amount"`
    ProductCode        string `json:"product_code"`
    ProductDescription string `json:"product_description"`
    Quantity           int64  `json:"quantity"`
    TaxAmount          int64  `json:"tax_amount"`
    UnitCost           int64  `json:"unit_cost"`
}

ChargeLevel3LineItem represents a line item on level III data. This is in private beta and would be empty for most integrations

type ChargeLevel3LineItemsParams Uses

type ChargeLevel3LineItemsParams struct {
    DiscountAmount     *int64  `form:"discount_amount"`
    ProductCode        *string `form:"product_code"`
    ProductDescription *string `form:"product_description"`
    Quantity           *int64  `form:"quantity"`
    TaxAmount          *int64  `form:"tax_amount"`
    UnitCost           *int64  `form:"unit_cost"`
}

ChargeLevel3LineItemsParams is the set of parameters that represent a line item on level III data.

type ChargeLevel3Params Uses

type ChargeLevel3Params struct {
    CustomerReference  *string                        `form:"customer_reference"`
    LineItems          []*ChargeLevel3LineItemsParams `form:"line_items"`
    MerchantReference  *string                        `form:"merchant_reference"`
    ShippingAddressZip *string                        `form:"shipping_address_zip"`
    ShippingFromZip    *string                        `form:"shipping_from_zip"`
    ShippingAmount     *int64                         `form:"shipping_amount"`
}

ChargeLevel3Params is the set of parameters that can be used for the Level III data.

type ChargeList Uses

type ChargeList struct {
    ListMeta
    Data []*Charge `json:"data"`
}

ChargeList is a list of charges as retrieved from a list endpoint.

type ChargeListParams Uses

type ChargeListParams struct {
    ListParams    `form:"*"`
    Created       *int64            `form:"created"`
    CreatedRange  *RangeQueryParams `form:"created"`
    Customer      *string           `form:"customer"`
    PaymentIntent *string           `form:"payment_intent"`
    TransferGroup *string           `form:"transfer_group"`
}

ChargeListParams is the set of parameters that can be used when listing charges.

type ChargeOutcome Uses

type ChargeOutcome struct {
    NetworkStatus string             `json:"network_status"`
    Reason        string             `json:"reason"`
    RiskLevel     string             `json:"risk_level"`
    RiskScore     int64              `json:"risk_score"`
    Rule          *ChargeOutcomeRule `json:"rule"`
    SellerMessage string             `json:"seller_message"`
    Type          string             `json:"type"`
}

ChargeOutcome is the charge's outcome that details whether a payment was accepted and why.

type ChargeOutcomeRule Uses

type ChargeOutcomeRule struct {
    Action    string `json:"action"`
    ID        string `json:"id"`
    Predicate string `json:"predicate"`
}

ChargeOutcomeRule tells you the Radar rule that blocked the charge, if any.

func (*ChargeOutcomeRule) UnmarshalJSON Uses

func (c *ChargeOutcomeRule) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a ChargeOutcomeRule. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type ChargeParams Uses

type ChargeParams struct {
    Params                    `form:"*"`
    Amount                    *int64                    `form:"amount"`
    ApplicationFeeAmount      *int64                    `form:"application_fee_amount"`
    Capture                   *bool                     `form:"capture"`
    Currency                  *string                   `form:"currency"`
    Customer                  *string                   `form:"customer"`
    Description               *string                   `form:"description"`
    Destination               *DestinationParams        `form:"destination"`
    ExchangeRate              *float64                  `form:"exchange_rate"`
    FraudDetails              *FraudDetailsParams       `form:"fraud_details"`
    Level3                    *ChargeLevel3Params       `form:"level3"`
    OnBehalfOf                *string                   `form:"on_behalf_of"`
    ReceiptEmail              *string                   `form:"receipt_email"`
    Shipping                  *ShippingDetailsParams    `form:"shipping"`
    Source                    *SourceParams             `form:"*"` // SourceParams has custom encoding so brought to top level with "*"
    StatementDescriptor       *string                   `form:"statement_descriptor"`
    StatementDescriptorSuffix *string                   `form:"statement_descriptor_suffix"`
    TransferData              *ChargeTransferDataParams `form:"transfer_data"`
    TransferGroup             *string                   `form:"transfer_group"`
}

ChargeParams is the set of parameters that can be used when creating or updating a charge.

func (*ChargeParams) SetSource Uses

func (p *ChargeParams) SetSource(sp interface{}) error

SetSource adds valid sources to a ChargeParams object, returning an error for unsupported sources.

type ChargePaymentMethodDetails Uses

type ChargePaymentMethodDetails struct {
    AchCreditTransfer *ChargePaymentMethodDetailsAchCreditTransfer `json:"ach_credit_transfer"`
    AchDebit          *ChargePaymentMethodDetailsAchDebit          `json:"ach_debit"`
    Alipay            *ChargePaymentMethodDetailsAlipay            `json:"alipay"`
    Bancontact        *ChargePaymentMethodDetailsBancontact        `json:"bancontact"`
    AUBECSDebit       *ChargePaymentMethodDetailsAUBECSDebit       `json:"au_becs_debit"`
    Bitcoin           *ChargePaymentMethodDetailsBitcoin           `json:"bitcoin"`
    Card              *ChargePaymentMethodDetailsCard              `json:"card"`
    CardPresent       *ChargePaymentMethodDetailsCardPresent       `json:"card_present"`
    Eps               *ChargePaymentMethodDetailsEps               `json:"eps"`
    FPX               *ChargePaymentMethodDetailsFPX               `json:"fpx"`
    Giropay           *ChargePaymentMethodDetailsGiropay           `json:"giropay"`
    Ideal             *ChargePaymentMethodDetailsIdeal             `json:"ideal"`
    Klarna            *ChargePaymentMethodDetailsKlarna            `json:"klarna"`
    Multibanco        *ChargePaymentMethodDetailsMultibanco        `json:"multibanco"`
    P24               *ChargePaymentMethodDetailsP24               `json:"p24"`
    SepaDebit         *ChargePaymentMethodDetailsSepaDebit         `json:"sepa_debit"`
    Sofort            *ChargePaymentMethodDetailsSofort            `json:"sofort"`
    StripeAccount     *ChargePaymentMethodDetailsStripeAccount     `json:"stripe_account"`
    Type              ChargePaymentMethodDetailsType               `json:"type"`
    Wechat            *ChargePaymentMethodDetailsWechat            `json:"wechat"`
}

ChargePaymentMethodDetails represents the details about the PaymentMethod associated with the charge.

type ChargePaymentMethodDetailsAUBECSDebit Uses

type ChargePaymentMethodDetailsAUBECSDebit struct {
    BSBNumber   string `json:"bsb_number"`
    Fingerprint string `json:"fingerprint"`
    Last4       string `json:"last4"`
    Mandate     string `json:"mandate"`
}

ChargePaymentMethodDetailsAUBECSDebit represents details about the AU BECS DD PaymentMethod.

type ChargePaymentMethodDetailsAchCreditTransfer Uses

type ChargePaymentMethodDetailsAchCreditTransfer struct {
    AccountNumber string `json:"account_number"`
    BankName      string `json:"bank_name"`
    RoutingNumber string `json:"routing_number"`
    SwiftCode     string `json:"swift_code"`
}

ChargePaymentMethodDetailsAchCreditTransfer represents details about the ACH Credit Transfer PaymentMethod.

type ChargePaymentMethodDetailsAchDebit Uses

type ChargePaymentMethodDetailsAchDebit struct {
    AccountHolderType BankAccountAccountHolderType `json:"account_holder_type"`
    BankName          string                       `json:"bank_name"`
    Country           string                       `json:"country"`
    Fingerprint       string                       `json:"fingerprint"`
    Last4             string                       `json:"last4"`
    RoutingNumber     string                       `json:"routing_number"`
}

ChargePaymentMethodDetailsAchDebit represents details about the ACH Debit PaymentMethod.

type ChargePaymentMethodDetailsAcssDebit Uses

type ChargePaymentMethodDetailsAcssDebit struct {
    Country       string `json:"country"`
    Fingerprint   string `json:"fingerprint"`
    Last4         string `json:"last4"`
    RoutingNumber string `json:"routing_number"`
}

ChargePaymentMethodDetailsAcssDebit represents details about the ACSS Debit PaymentMethod.

type ChargePaymentMethodDetailsAlipay Uses

type ChargePaymentMethodDetailsAlipay struct {
}

ChargePaymentMethodDetailsAlipay represents details about the Alipay PaymentMethod.

type ChargePaymentMethodDetailsBancontact Uses

type ChargePaymentMethodDetailsBancontact struct {
    BankCode          string `json:"bank_code"`
    BankName          string `json:"bank_name"`
    Bic               string `json:"bic"`
    IbanLast4         string `json:"iban_last4"`
    PreferredLanguage string `json:"preferred_language"`
    VerifiedName      string `json:"verified_name"`
}

ChargePaymentMethodDetailsBancontact represents details about the Bancontact PaymentMethod.

type ChargePaymentMethodDetailsBitcoin Uses

type ChargePaymentMethodDetailsBitcoin struct {
    Address        string `json:"address"`
    Amount         int64  `json:"amount"`
    AmountCharged  int64  `json:"amount_charged"`
    AmountReceived int64  `json:"amount_received"`
    AmountReturned int64  `json:"amount_returned"`
    RefundAddress  string `json:"refund_address"`
}

ChargePaymentMethodDetailsBitcoin represents details about the Bitcoin PaymentMethod.

type ChargePaymentMethodDetailsCard Uses

type ChargePaymentMethodDetailsCard struct {
    Brand        PaymentMethodCardBrand                      `json:"brand"`
    Checks       *ChargePaymentMethodDetailsCardChecks       `json:"checks"`
    Country      string                                      `json:"country"`
    ExpMonth     uint64                                      `json:"exp_month"`
    ExpYear      uint64                                      `json:"exp_year"`
    Fingerprint  string                                      `json:"fingerprint"`
    Funding      CardFunding                                 `json:"funding"`
    Installments *ChargePaymentMethodDetailsCardInstallments `json:"installments"`
    Last4        string                                      `json:"last4"`
    MOTO         bool                                        `json:"moto"`
    ThreeDSecure *ChargePaymentMethodDetailsCardThreeDSecure `json:"three_d_secure"`
    Wallet       *ChargePaymentMethodDetailsCardWallet       `json:"wallet"`

    // Please note that the fields below are for internal use only and are not returned
    // as part of standard API requests.
    Description string `json:"description"`
    IIN         string `json:"iin"`
    Issuer      string `json:"issuer"`
}

ChargePaymentMethodDetailsCard represents details about the Card PaymentMethod.

type ChargePaymentMethodDetailsCardChecks Uses

type ChargePaymentMethodDetailsCardChecks struct {
    AddressLine1Check      CardVerification `json:"address_line1_check"`
    AddressPostalCodeCheck CardVerification `json:"address_postal_code_check"`
    CVCCheck               CardVerification `json:"cvc_check"`
}

ChargePaymentMethodDetailsCardChecks represents the checks associated with the charge's Card PaymentMethod.

type ChargePaymentMethodDetailsCardInstallments Uses

type ChargePaymentMethodDetailsCardInstallments struct {
    Plan *PaymentIntentPaymentMethodOptionsCardInstallmentsPlan `json:"plan"`
}

ChargePaymentMethodDetailsCardInstallments represents details about the installment plan chosen for this charge.

type ChargePaymentMethodDetailsCardPresent Uses

type ChargePaymentMethodDetailsCardPresent struct {
    Brand         PaymentMethodCardBrand                        `json:"brand"`
    Country       string                                        `json:"country"`
    EmvAuthData   string                                        `json:"emv_auth_data"`
    ExpMonth      uint64                                        `json:"exp_month"`
    ExpYear       uint64                                        `json:"exp_year"`
    Fingerprint   string                                        `json:"fingerprint"`
    Funding       CardFunding                                   `json:"funding"`
    GeneratedCard string                                        `json:"generated_card"`
    Last4         string                                        `json:"last4"`
    ReadMethod    string                                        `json:"read_method"`
    Receipt       *ChargePaymentMethodDetailsCardPresentReceipt `json:"receipt"`
}

ChargePaymentMethodDetailsCardPresent represents details about the Card Present PaymentMethod.

type ChargePaymentMethodDetailsCardPresentReceipt Uses

type ChargePaymentMethodDetailsCardPresentReceipt struct {
    ApplicationCryptogram        string `json:"application_cryptogram"`
    ApplicationPreferredName     string `json:"application_preferred_name"`
    AuthorizationCode            string `json:"authorization_code"`
    AuthorizationResponseCode    string `json:"authorization_response_code"`
    CardholderVerificationMethod string `json:"cardholder_verification_method"`
    DedicatedFileName            string `json:"dedicated_file_name"`
    TerminalVerificationResults  string `json:"terminal_verification_results"`
    TransactionStatusInformation string `json:"transaction_status_information"`
}

ChargePaymentMethodDetailsCardPresentReceipt represents details about the receipt on a Card Present PaymentMethod.

type ChargePaymentMethodDetailsCardThreeDSecure Uses

type ChargePaymentMethodDetailsCardThreeDSecure struct {
    Authenticated bool   `json:"authenticated"`
    Succeeded     bool   `json:"succeeded"`
    Version       string `json:"version"`
}

ChargePaymentMethodDetailsCardThreeDSecure represents details about 3DS associated with the charge's PaymentMethod.

type ChargePaymentMethodDetailsCardWallet Uses

type ChargePaymentMethodDetailsCardWallet struct {
    AmexExpressCheckout *ChargePaymentMethodDetailsCardWalletAmexExpressCheckout `json:"amex_express_checkout"`
    ApplePay            *ChargePaymentMethodDetailsCardWalletApplePay            `json:"apple_pay"`
    DynamicLast4        string                                                   `json:"dynamic_last4"`
    GooglePay           *ChargePaymentMethodDetailsCardWalletGooglePay           `json:"google_pay"`
    Masterpass          *ChargePaymentMethodDetailsCardWalletMasterpass          `json:"masterpass"`
    SamsungPay          *ChargePaymentMethodDetailsCardWalletSamsungPay          `json:"samsung_pay"`
    Type                PaymentMethodCardWalletType                              `json:"type"`
    VisaCheckout        *ChargePaymentMethodDetailsCardWalletVisaCheckout        `json:"visa_checkout"`
}

ChargePaymentMethodDetailsCardWallet represents the details of the card wallet if this Card PaymentMethod is part of a card wallet.

type ChargePaymentMethodDetailsCardWalletAmexExpressCheckout Uses

type ChargePaymentMethodDetailsCardWalletAmexExpressCheckout struct {
}

ChargePaymentMethodDetailsCardWalletAmexExpressCheckout represents the details of the Amex Express Checkout wallet.

type ChargePaymentMethodDetailsCardWalletApplePay Uses

type ChargePaymentMethodDetailsCardWalletApplePay struct {
}

ChargePaymentMethodDetailsCardWalletApplePay represents the details of the Apple Pay wallet.

type ChargePaymentMethodDetailsCardWalletGooglePay Uses

type ChargePaymentMethodDetailsCardWalletGooglePay struct {
}

ChargePaymentMethodDetailsCardWalletGooglePay represents the details of the Google Pay wallet.

type ChargePaymentMethodDetailsCardWalletMasterpass Uses

type ChargePaymentMethodDetailsCardWalletMasterpass struct {
    BillingAddress  *Address `json:"billing_address"`
    Email           string   `json:"email"`
    Name            string   `json:"name"`
    ShippingAddress *Address `json:"shipping_address"`
}

ChargePaymentMethodDetailsCardWalletMasterpass represents the details of the Masterpass wallet.

type ChargePaymentMethodDetailsCardWalletSamsungPay Uses

type ChargePaymentMethodDetailsCardWalletSamsungPay struct {
}

ChargePaymentMethodDetailsCardWalletSamsungPay represents the details of the Samsung Pay wallet.

type ChargePaymentMethodDetailsCardWalletVisaCheckout Uses

type ChargePaymentMethodDetailsCardWalletVisaCheckout struct {
    BillingAddress  *Address `json:"billing_address"`
    Email           string   `json:"email"`
    Name            string   `json:"name"`
    ShippingAddress *Address `json:"shipping_address"`
}

ChargePaymentMethodDetailsCardWalletVisaCheckout represents the details of the Visa Checkout wallet.

type ChargePaymentMethodDetailsEps Uses

type ChargePaymentMethodDetailsEps struct {
    VerifiedName string `json:"verified_name"`
}

ChargePaymentMethodDetailsEps represents details about the EPS PaymentMethod.

type ChargePaymentMethodDetailsFPX Uses

type ChargePaymentMethodDetailsFPX struct {
    AccountHolderType PaymentMethodFPXAccountHolderType `json:"account_holder_type"`
    Bank              string                            `json:"bank"`
    TransactionID     string                            `json:"transaction_id"`
}

ChargePaymentMethodDetailsFPX represents details about the FPX PaymentMethod.

type ChargePaymentMethodDetailsGiropay Uses

type ChargePaymentMethodDetailsGiropay struct {
    BankCode     string `json:"bank_code"`
    BankName     string `json:"bank_name"`
    Bic          string `json:"bic"`
    VerifiedName string `json:"verified_name"`
}

ChargePaymentMethodDetailsGiropay represents details about the Giropay PaymentMethod.

type ChargePaymentMethodDetailsIdeal Uses

type ChargePaymentMethodDetailsIdeal struct {
    Bank         string `json:"bank"`
    Bic          string `json:"bic"`
    IbanLast4    string `json:"iban_last4"`
    VerifiedName string `json:"verified_name"`
}

ChargePaymentMethodDetailsIdeal represents details about the Ideal PaymentMethod.

type ChargePaymentMethodDetailsKlarna Uses

type ChargePaymentMethodDetailsKlarna struct {
}

ChargePaymentMethodDetailsKlarna represents details for the Klarna PaymentMethod.

type ChargePaymentMethodDetailsMultibanco Uses

type ChargePaymentMethodDetailsMultibanco struct {
    Entity    string `json:"entity"`
    Reference string `json:"reference"`
}

ChargePaymentMethodDetailsMultibanco represents details about the Multibanco PaymentMethod.

type ChargePaymentMethodDetailsP24 Uses

type ChargePaymentMethodDetailsP24 struct {
    Reference    string `json:"reference"`
    VerifiedName string `json:"verified_name"`
}

ChargePaymentMethodDetailsP24 represents details about the P24 PaymentMethod.

type ChargePaymentMethodDetailsSepaDebit Uses

type ChargePaymentMethodDetailsSepaDebit struct {
    BankCode    string `json:"bank_code"`
    BranchCode  string `json:"branch_code"`
    Country     string `json:"country"`
    Fingerprint string `json:"fingerprint"`
    Last4       string `json:"last4"`
}

ChargePaymentMethodDetailsSepaDebit represents details about the Sepa Debit PaymentMethod.

type ChargePaymentMethodDetailsSofort Uses

type ChargePaymentMethodDetailsSofort struct {
    BankCode     string `json:"bank_code"`
    BankName     string `json:"bank_name"`
    Bic          string `json:"bic"`
    Country      string `json:"country"`
    IbanLast4    string `json:"iban_last4"`
    VerifiedName string `json:"verified_name"`
}

ChargePaymentMethodDetailsSofort represents details about the Sofort PaymentMethod.

type ChargePaymentMethodDetailsStripeAccount Uses

type ChargePaymentMethodDetailsStripeAccount struct {
}

ChargePaymentMethodDetailsStripeAccount represents details about the StripeAccount PaymentMethod.

type ChargePaymentMethodDetailsType Uses

type ChargePaymentMethodDetailsType string

ChargePaymentMethodDetailsType is the type of the PaymentMethod associated with the Charge's payment method details.

const (
    ChargePaymentMethodDetailsTypeAchCreditTransfer ChargePaymentMethodDetailsType = "ach_credit_transfer"
    ChargePaymentMethodDetailsTypeAchDebit          ChargePaymentMethodDetailsType = "ach_debit"
    ChargePaymentMethodDetailsTypeAcssDebit         ChargePaymentMethodDetailsType = "acss_debit"
    ChargePaymentMethodDetailsTypeAlipay            ChargePaymentMethodDetailsType = "alipay"
    ChargePaymentMethodDetailsTypeAUBECSDebit       ChargePaymentMethodDetailsType = "au_becs_debit"
    ChargePaymentMethodDetailsTypeBancontact        ChargePaymentMethodDetailsType = "bancontact"
    ChargePaymentMethodDetailsTypeBitcoin           ChargePaymentMethodDetailsType = "bitcoin" // This is unsupported today and is here for legacy charges.
    ChargePaymentMethodDetailsTypeCard              ChargePaymentMethodDetailsType = "card"
    ChargePaymentMethodDetailsTypeCardPresent       ChargePaymentMethodDetailsType = "card_present"
    ChargePaymentMethodDetailsTypeEps               ChargePaymentMethodDetailsType = "eps"
    ChargePaymentMethodDetailsTypeFPX               ChargePaymentMethodDetailsType = "fpx"
    ChargePaymentMethodDetailsTypeGiropay           ChargePaymentMethodDetailsType = "giropay"
    ChargePaymentMethodDetailsTypeIdeal             ChargePaymentMethodDetailsType = "ideal"
    ChargePaymentMethodDetailsTypeKlarna            ChargePaymentMethodDetailsType = "klarna"
    ChargePaymentMethodDetailsTypeMultibanco        ChargePaymentMethodDetailsType = "multibanco"
    ChargePaymentMethodDetailsTypeP24               ChargePaymentMethodDetailsType = "p24"
    ChargePaymentMethodDetailsTypeSepaDebit         ChargePaymentMethodDetailsType = "sepa_debit"
    ChargePaymentMethodDetailsTypeSofort            ChargePaymentMethodDetailsType = "sofort"
    ChargePaymentMethodDetailsTypeStripeAccount     ChargePaymentMethodDetailsType = "stripe_account"
    ChargePaymentMethodDetailsTypeWechat            ChargePaymentMethodDetailsType = "wechat"
)

List of values that ChargePaymentMethodDetailsType can take.

type ChargePaymentMethodDetailsWechat Uses

type ChargePaymentMethodDetailsWechat struct {
}

ChargePaymentMethodDetailsWechat represents details about the Wechat PaymentMethod.

type ChargeTransferData Uses

type ChargeTransferData struct {
    Amount      int64    `form:"amount"`
    Destination *Account `json:"destination"`
}

ChargeTransferData represents the information for the transfer_data associated with a charge.

type ChargeTransferDataParams Uses

type ChargeTransferDataParams struct {
    Amount *int64 `form:"amount"`
    // This parameter can only be used on Charge creation.
    Destination *string `form:"destination"`
}

ChargeTransferDataParams is the set of parameters allowed for the transfer_data hash.

type CheckoutSession Uses

type CheckoutSession struct {
    CancelURL          string                        `json:"cancel_url"`
    ClientReferenceID  string                        `json:"client_reference_id"`
    Customer           *Customer                     `json:"customer"`
    CustomerEmail      string                        `json:"customer_email"`
    Deleted            bool                          `json:"deleted"`
    DisplayItems       []*CheckoutSessionDisplayItem `json:"display_items"`
    ID                 string                        `json:"id"`
    Livemode           bool                          `json:"livemode"`
    Locale             string                        `json:"locale"`
    Mode               CheckoutSessionMode           `json:"mode"`
    Object             string                        `json:"object"`
    PaymentIntent      *PaymentIntent                `json:"payment_intent"`
    PaymentMethodTypes []string                      `json:"payment_method_types"`
    SetupIntent        *SetupIntent                  `json:"setup_intent"`
    Subscription       *Subscription                 `json:"subscription"`
    SubmitType         CheckoutSessionSubmitType     `json:"submit_type"`
    SuccessURL         string                        `json:"success_url"`
}

CheckoutSession is the resource representing a Stripe checkout session. For more details see https://stripe.com/docs/api/checkout/sessions/object

func (*CheckoutSession) UnmarshalJSON Uses

func (p *CheckoutSession) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a checkout session. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CheckoutSessionDisplayItem Uses

type CheckoutSessionDisplayItem struct {
    Amount   int64                             `json:"amount"`
    Currency Currency                          `json:"currency"`
    Custom   *CheckoutSessionDisplayItemCustom `json:"custom"`
    Quantity int64                             `json:"quantity"`
    Plan     *Plan                             `json:"plan"`
    SKU      *SKU                              `json:"sku"`
    Type     CheckoutSessionDisplayItemType    `json:"type"`
}

CheckoutSessionDisplayItem represents one of the items in a checkout session.

type CheckoutSessionDisplayItemCustom Uses

type CheckoutSessionDisplayItemCustom struct {
    Description string   `json:"description"`
    Images      []string `json:"images"`
    Name        string   `json:"name"`
}

CheckoutSessionDisplayItemCustom represents an item of type custom in a checkout session

type CheckoutSessionDisplayItemType Uses

type CheckoutSessionDisplayItemType string

CheckoutSessionDisplayItemType is the list of allowed values for the display item type.

const (
    CheckoutSessionDisplayItemTypeCustom CheckoutSessionDisplayItemType = "custom"
    CheckoutSessionDisplayItemTypePlan   CheckoutSessionDisplayItemType = "plan"
    CheckoutSessionDisplayItemTypeSKU    CheckoutSessionDisplayItemType = "sku"
)

List of values that CheckoutSessionDisplayItemType can take.

type CheckoutSessionLineItemParams Uses

type CheckoutSessionLineItemParams struct {
    Amount      *int64    `form:"amount"`
    Currency    *string   `form:"currency"`
    Description *string   `form:"description"`
    Images      []*string `form:"images"`
    Name        *string   `form:"name"`
    Quantity    *int64    `form:"quantity"`
}

CheckoutSessionLineItemParams is the set of parameters allowed for a line item on a checkout session.

type CheckoutSessionMode Uses

type CheckoutSessionMode string

CheckoutSessionMode is the list of allowed values for the mode on a Session.

const (
    CheckoutSessionModePayment      CheckoutSessionMode = "payment"
    CheckoutSessionModeSetup        CheckoutSessionMode = "setup"
    CheckoutSessionModeSubscription CheckoutSessionMode = "subscription"
)

List of values that CheckoutSessionMode can take.

type CheckoutSessionParams Uses

type CheckoutSessionParams struct {
    Params                   `form:"*"`
    BillingAddressCollection *string                                 `form:"billing_address_collection"`
    CancelURL                *string                                 `form:"cancel_url"`
    ClientReferenceID        *string                                 `form:"client_reference_id"`
    Customer                 *string                                 `form:"customer"`
    CustomerEmail            *string                                 `form:"customer_email"`
    LineItems                []*CheckoutSessionLineItemParams        `form:"line_items"`
    Locale                   *string                                 `form:"locale"`
    Mode                     *string                                 `form:"mode"`
    PaymentIntentData        *CheckoutSessionPaymentIntentDataParams `form:"payment_intent_data"`
    PaymentMethodTypes       []*string                               `form:"payment_method_types"`
    SetupIntentData          *CheckoutSessionSetupIntentDataParams   `form:"setup_intent_data"`
    SubscriptionData         *CheckoutSessionSubscriptionDataParams  `form:"subscription_data"`
    SubmitType               *string                                 `form:"submit_type"`
    SuccessURL               *string                                 `form:"success_url"`
}

CheckoutSessionParams is the set of parameters that can be used when creating a checkout session. For more details see https://stripe.com/docs/api/checkout/sessions/create

type CheckoutSessionPaymentIntentDataParams Uses

type CheckoutSessionPaymentIntentDataParams struct {
    Params               `form:"*"`
    ApplicationFeeAmount *int64                                              `form:"application_fee_amount"`
    CaptureMethod        *string                                             `form:"capture_method"`
    Description          *string                                             `form:"description"`
    OnBehalfOf           *string                                             `form:"on_behalf_of"`
    ReceiptEmail         *string                                             `form:"receipt_email"`
    SetupFutureUsage     *string                                             `form:"setup_future_usage"`
    Shipping             *ShippingDetailsParams                              `form:"shipping"`
    StatementDescriptor  *string                                             `form:"statement_descriptor"`
    TransferData         *CheckoutSessionPaymentIntentDataTransferDataParams `form:"transfer_data"`
}

CheckoutSessionPaymentIntentDataParams is the set of parameters allowed for the payment intent creation on a checkout session.

type CheckoutSessionPaymentIntentDataTransferDataParams Uses

type CheckoutSessionPaymentIntentDataTransferDataParams struct {
    Destination *string `form:"destination"`
}

CheckoutSessionPaymentIntentDataTransferDataParams is the set of parameters allowed for the transfer_data hash.

type CheckoutSessionSetupIntentDataParams Uses

type CheckoutSessionSetupIntentDataParams struct {
    Params      `form:"*"`
    Description *string `form:"description"`
    OnBehalfOf  *string `form:"on_behalf_of"`
}

CheckoutSessionSetupIntentDataParams is the set of parameters allowed for the setup intent creation on a checkout session.

type CheckoutSessionSubmitType Uses

type CheckoutSessionSubmitType string

CheckoutSessionSubmitType is the list of allowed values for the `submit_type` of a Session.

const (
    CheckoutSessionSubmitTypeAuto   CheckoutSessionSubmitType = "auto"
    CheckoutSessionSubmitTypeBook   CheckoutSessionSubmitType = "book"
    CheckoutSessionSubmitTypeDonate CheckoutSessionSubmitType = "donate"
    CheckoutSessionSubmitTypePay    CheckoutSessionSubmitType = "pay"
)

List of values that CheckoutSessionSubmitType can take.

type CheckoutSessionSubscriptionDataItemsParams Uses

type CheckoutSessionSubscriptionDataItemsParams struct {
    Plan     *string `form:"plan"`
    Quantity *int64  `form:"quantity"`
}

CheckoutSessionSubscriptionDataItemsParams is the set of parameters allowed for one item on a checkout session associated with a subscription.

type CheckoutSessionSubscriptionDataParams Uses

type CheckoutSessionSubscriptionDataParams struct {
    Params                `form:"*"`
    ApplicationFeePercent *float64                                      `form:"application_fee_percent"`
    Items                 []*CheckoutSessionSubscriptionDataItemsParams `form:"items"`
    TrialEnd              *int64                                        `form:"trial_end"`
    TrialFromPlan         *bool                                         `form:"trial_from_plan"`
    TrialPeriodDays       *int64                                        `form:"trial_period_days"`
}

CheckoutSessionSubscriptionDataParams is the set of parameters allowed for the subscription creation on a checkout session.

type CodeVerificationFlow Uses

type CodeVerificationFlow struct {
    AttemptsRemaining int64                            `json:"attempts_remaining"`
    Status            SourceCodeVerificationFlowStatus `json:"status"`
}

CodeVerificationFlow informs of the state of a verification authentication flow.

type Country Uses

type Country string

Country is the list of supported countries

type CountrySpec Uses

type CountrySpec struct {
    DefaultCurrency                Currency                                        `json:"default_currency"`
    ID                             string                                          `json:"id"`
    SupportedBankAccountCurrencies map[Currency][]Country                          `json:"supported_bank_account_currencies"`
    SupportedPaymentCurrencies     []Currency                                      `json:"supported_payment_currencies"`
    SupportedPaymentMethods        []string                                        `json:"supported_payment_methods"`
    SupportedTransferCountries     []string                                        `json:"supported_transfer_countries"`
    VerificationFields             map[AccountBusinessType]*VerificationFieldsList `json:"verification_fields"`
}

CountrySpec is the resource representing the rules required for a Stripe account. For more details see https://stripe.com/docs/api/#country_specs.

type CountrySpecList Uses

type CountrySpecList struct {
    ListMeta
    Data []*CountrySpec `json:"data"`
}

CountrySpecList is a list of country specs as retrieved from a list endpoint.

type CountrySpecListParams Uses

type CountrySpecListParams struct {
    ListParams `form:"*"`
}

CountrySpecListParams are the parameters allowed during CountrySpec listing.

type CountrySpecParams Uses

type CountrySpecParams struct {
    Params `form:"*"`
}

CountrySpecParams are the parameters allowed during CountrySpec retrieval.

type Coupon Uses

type Coupon struct {
    AmountOff        int64             `json:"amount_off"`
    Created          int64             `json:"created"`
    Currency         Currency          `json:"currency"`
    Deleted          bool              `json:"deleted"`
    Duration         CouponDuration    `json:"duration"`
    DurationInMonths int64             `json:"duration_in_months"`
    ID               string            `json:"id"`
    Livemode         bool              `json:"livemode"`
    MaxRedemptions   int64             `json:"max_redemptions"`
    Metadata         map[string]string `json:"metadata"`
    Name             string            `json:"name"`
    PercentOff       float64           `json:"percent_off"`
    RedeemBy         int64             `json:"redeem_by"`
    TimesRedeemed    int64             `json:"times_redeemed"`
    Valid            bool              `json:"valid"`
}

Coupon is the resource representing a Stripe coupon. For more details see https://stripe.com/docs/api#coupons.

func (*Coupon) UnmarshalJSON Uses

func (c *Coupon) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Coupon. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CouponDuration Uses

type CouponDuration string

CouponDuration is the list of allowed values for the coupon's duration.

const (
    CouponDurationForever   CouponDuration = "forever"
    CouponDurationOnce      CouponDuration = "once"
    CouponDurationRepeating CouponDuration = "repeating"
)

List of values that CouponDuration can take.

type CouponList Uses

type CouponList struct {
    ListMeta
    Data []*Coupon `json:"data"`
}

CouponList is a list of coupons as retrieved from a list endpoint.

type CouponListParams Uses

type CouponListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
}

CouponListParams is the set of parameters that can be used when listing coupons. For more detail see https://stripe.com/docs/api#list_coupons.

type CouponParams Uses

type CouponParams struct {
    Params           `form:"*"`
    AmountOff        *int64   `form:"amount_off"`
    Currency         *string  `form:"currency"`
    Duration         *string  `form:"duration"`
    DurationInMonths *int64   `form:"duration_in_months"`
    ID               *string  `form:"id"`
    MaxRedemptions   *int64   `form:"max_redemptions"`
    Name             *string  `form:"name"`
    PercentOff       *float64 `form:"percent_off"`
    RedeemBy         *int64   `form:"redeem_by"`
}

CouponParams is the set of parameters that can be used when creating a coupon. For more details see https://stripe.com/docs/api#create_coupon.

type CreditNote Uses

type CreditNote struct {
    Amount                     int64                       `json:"amount"`
    Created                    int64                       `json:"created"`
    Currency                   Currency                    `json:"currency"`
    Customer                   *Customer                   `json:"customer"`
    CustomerBalanceTransaction *CustomerBalanceTransaction `json:"customer_balance_transaction"`
    Invoice                    *Invoice                    `json:"invoice"`
    ID                         string                      `json:"id"`
    Livemode                   bool                        `json:"livemode"`
    Memo                       string                      `json:"memo"`
    Metadata                   map[string]string           `json:"metadata"`
    Number                     string                      `json:"number"`
    Object                     string                      `json:"object"`
    PDF                        string                      `json:"pdf"`
    Reason                     CreditNoteReason            `json:"reason"`
    Refund                     *Refund                     `json:"refund"`
    Status                     CreditNoteStatus            `json:"status"`
    Type                       CreditNoteType              `json:"type"`
    VoidedAt                   int64                       `json:"voided_at"`
}

CreditNote is the resource representing a Stripe credit note. For more details see https://stripe.com/docs/api/credit_notes/object.

func (*CreditNote) UnmarshalJSON Uses

func (i *CreditNote) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a CreditNote. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CreditNoteList Uses

type CreditNoteList struct {
    ListMeta
    Data []*CreditNote `json:"data"`
}

CreditNoteList is a list of credit notes as retrieved from a list endpoint.

type CreditNoteListParams Uses

type CreditNoteListParams struct {
    ListParams `form:"*"`
    Customer   *string `form:"customer"`
    Invoice    *string `form:"invoice"`
}

CreditNoteListParams is the set of parameters that can be used when listing credit notes. For more details see https://stripe.com/docs/api/credit_notes/list.

type CreditNoteParams Uses

type CreditNoteParams struct {
    Params       `form:"*"`
    Amount       *int64  `form:"amount"`
    CreditAmount *int64  `form:"credit_amount"`
    Invoice      *string `form:"invoice"`
    Memo         *string `form:"memo"`
    Reason       *string `form:"reason"`
    Refund       *string `form:"refund"`
    RefundAmount *int64  `form:"refund_amount"`
}

CreditNoteParams is the set of parameters that can be used when creating or updating a credit note. For more details see https://stripe.com/docs/api/credit_notes/create, https://stripe.com/docs/api/credit_notes/update.

type CreditNoteReason Uses

type CreditNoteReason string

CreditNoteReason is the reason why a given credit note was created.

const (
    CreditNoteReasonDuplicate             CreditNoteReason = "duplicate"
    CreditNoteReasonFraudulent            CreditNoteReason = "fraudulent"
    CreditNoteReasonOrderChange           CreditNoteReason = "order_change"
    CreditNoteReasonProductUnsatisfactory CreditNoteReason = "product_unsatisfactory"
)

List of values that CreditNoteReason can take.

type CreditNoteStatus Uses

type CreditNoteStatus string

CreditNoteStatus is the list of allowed values for the credit note's status.

const (
    CreditNoteStatusIssued CreditNoteStatus = "issued"
    CreditNoteStatusVoid   CreditNoteStatus = "void"
)

List of values that CreditNoteStatus can take.

type CreditNoteType Uses

type CreditNoteType string

CreditNoteType is the list of allowed values for the credit note's type.

const (
    CreditNoteTypePostPayment CreditNoteType = "post_payment"
    CreditNoteTypePrePayment  CreditNoteType = "pre_payment"
)

List of values that CreditNoteType can take.

type CreditNoteVoidParams Uses

type CreditNoteVoidParams struct {
    Params `form:"*"`
}

CreditNoteVoidParams is the set of parameters that can be used when voiding invoices.

type Currency Uses

type Currency string

Currency is the list of supported currencies. For more details see https://support.stripe.com/questions/which-currencies-does-stripe-support.

const (
    CurrencyAED Currency = "aed" // United Arab Emirates Dirham
    CurrencyAFN Currency = "afn" // Afghan Afghani
    CurrencyALL Currency = "all" // Albanian Lek
    CurrencyAMD Currency = "amd" // Armenian Dram
    CurrencyANG Currency = "ang" // Netherlands Antillean Gulden
    CurrencyAOA Currency = "aoa" // Angolan Kwanza
    CurrencyARS Currency = "ars" // Argentine Peso
    CurrencyAUD Currency = "aud" // Australian Dollar
    CurrencyAWG Currency = "awg" // Aruban Florin
    CurrencyAZN Currency = "azn" // Azerbaijani Manat
    CurrencyBAM Currency = "bam" // Bosnia & Herzegovina Convertible Mark
    CurrencyBBD Currency = "bbd" // Barbadian Dollar
    CurrencyBDT Currency = "bdt" // Bangladeshi Taka
    CurrencyBGN Currency = "bgn" // Bulgarian Lev
    CurrencyBIF Currency = "bif" // Burundian Franc
    CurrencyBMD Currency = "bmd" // Bermudian Dollar
    CurrencyBND Currency = "bnd" // Brunei Dollar
    CurrencyBOB Currency = "bob" // Bolivian Boliviano
    CurrencyBRL Currency = "brl" // Brazilian Real
    CurrencyBSD Currency = "bsd" // Bahamian Dollar
    CurrencyBWP Currency = "bwp" // Botswana Pula
    CurrencyBZD Currency = "bzd" // Belize Dollar
    CurrencyCAD Currency = "cad" // Canadian Dollar
    CurrencyCDF Currency = "cdf" // Congolese Franc
    CurrencyCHF Currency = "chf" // Swiss Franc
    CurrencyCLP Currency = "clp" // Chilean Peso
    CurrencyCNY Currency = "cny" // Chinese Renminbi Yuan
    CurrencyCOP Currency = "cop" // Colombian Peso
    CurrencyCRC Currency = "crc" // Costa Rican Colón
    CurrencyCVE Currency = "cve" // Cape Verdean Escudo
    CurrencyCZK Currency = "czk" // Czech Koruna
    CurrencyDJF Currency = "djf" // Djiboutian Franc
    CurrencyDKK Currency = "dkk" // Danish Krone
    CurrencyDOP Currency = "dop" // Dominican Peso
    CurrencyDZD Currency = "dzd" // Algerian Dinar
    CurrencyEEK Currency = "eek" // Estonian Kroon
    CurrencyEGP Currency = "egp" // Egyptian Pound
    CurrencyETB Currency = "etb" // Ethiopian Birr
    CurrencyEUR Currency = "eur" // Euro
    CurrencyFJD Currency = "fjd" // Fijian Dollar
    CurrencyFKP Currency = "fkp" // Falkland Islands Pound
    CurrencyGBP Currency = "gbp" // British Pound
    CurrencyGEL Currency = "gel" // Georgian Lari
    CurrencyGIP Currency = "gip" // Gibraltar Pound
    CurrencyGMD Currency = "gmd" // Gambian Dalasi
    CurrencyGNF Currency = "gnf" // Guinean Franc
    CurrencyGTQ Currency = "gtq" // Guatemalan Quetzal
    CurrencyGYD Currency = "gyd" // Guyanese Dollar
    CurrencyHKD Currency = "hkd" // Hong Kong Dollar
    CurrencyHNL Currency = "hnl" // Honduran Lempira
    CurrencyHRK Currency = "hrk" // Croatian Kuna
    CurrencyHTG Currency = "htg" // Haitian Gourde
    CurrencyHUF Currency = "huf" // Hungarian Forint
    CurrencyIDR Currency = "idr" // Indonesian Rupiah
    CurrencyILS Currency = "ils" // Israeli New Sheqel
    CurrencyINR Currency = "inr" // Indian Rupee
    CurrencyISK Currency = "isk" // Icelandic Króna
    CurrencyJMD Currency = "jmd" // Jamaican Dollar
    CurrencyJPY Currency = "jpy" // Japanese Yen
    CurrencyKES Currency = "kes" // Kenyan Shilling
    CurrencyKGS Currency = "kgs" // Kyrgyzstani Som
    CurrencyKHR Currency = "khr" // Cambodian Riel
    CurrencyKMF Currency = "kmf" // Comorian Franc
    CurrencyKRW Currency = "krw" // South Korean Won
    CurrencyKYD Currency = "kyd" // Cayman Islands Dollar
    CurrencyKZT Currency = "kzt" // Kazakhstani Tenge
    CurrencyLAK Currency = "lak" // Lao Kip
    CurrencyLBP Currency = "lbp" // Lebanese Pound
    CurrencyLKR Currency = "lkr" // Sri Lankan Rupee
    CurrencyLRD Currency = "lrd" // Liberian Dollar
    CurrencyLSL Currency = "lsl" // Lesotho Loti
    CurrencyLTL Currency = "ltl" // Lithuanian Litas
    CurrencyLVL Currency = "lvl" // Latvian Lats
    CurrencyMAD Currency = "mad" // Moroccan Dirham
    CurrencyMDL Currency = "mdl" // Moldovan Leu
    CurrencyMGA Currency = "mga" // Malagasy Ariary
    CurrencyMKD Currency = "mkd" // Macedonian Denar
    CurrencyMNT Currency = "mnt" // Mongolian Tögrög
    CurrencyMOP Currency = "mop" // Macanese Pataca
    CurrencyMRO Currency = "mro" // Mauritanian Ouguiya
    CurrencyMUR Currency = "mur" // Mauritian Rupee
    CurrencyMVR Currency = "mvr" // Maldivian Rufiyaa
    CurrencyMWK Currency = "mwk" // Malawian Kwacha
    CurrencyMXN Currency = "mxn" // Mexican Peso
    CurrencyMYR Currency = "myr" // Malaysian Ringgit
    CurrencyMZN Currency = "mzn" // Mozambican Metical
    CurrencyNAD Currency = "nad" // Namibian Dollar
    CurrencyNGN Currency = "ngn" // Nigerian Naira
    CurrencyNIO Currency = "nio" // Nicaraguan Córdoba
    CurrencyNOK Currency = "nok" // Norwegian Krone
    CurrencyNPR Currency = "npr" // Nepalese Rupee
    CurrencyNZD Currency = "nzd" // New Zealand Dollar
    CurrencyPAB Currency = "pab" // Panamanian Balboa
    CurrencyPEN Currency = "pen" // Peruvian Nuevo Sol
    CurrencyPGK Currency = "pgk" // Papua New Guinean Kina
    CurrencyPHP Currency = "php" // Philippine Peso
    CurrencyPKR Currency = "pkr" // Pakistani Rupee
    CurrencyPLN Currency = "pln" // Polish Złoty
    CurrencyPYG Currency = "pyg" // Paraguayan Guaraní
    CurrencyQAR Currency = "qar" // Qatari Riyal
    CurrencyRON Currency = "ron" // Romanian Leu
    CurrencyRSD Currency = "rsd" // Serbian Dinar
    CurrencyRUB Currency = "rub" // Russian Ruble
    CurrencyRWF Currency = "rwf" // Rwandan Franc
    CurrencySAR Currency = "sar" // Saudi Riyal
    CurrencySBD Currency = "sbd" // Solomon Islands Dollar
    CurrencySCR Currency = "scr" // Seychellois Rupee
    CurrencySEK Currency = "sek" // Swedish Krona
    CurrencySGD Currency = "sgd" // Singapore Dollar
    CurrencySHP Currency = "shp" // Saint Helenian Pound
    CurrencySLL Currency = "sll" // Sierra Leonean Leone
    CurrencySOS Currency = "sos" // Somali Shilling
    CurrencySRD Currency = "srd" // Surinamese Dollar
    CurrencySTD Currency = "std" // São Tomé and Príncipe Dobra
    CurrencySVC Currency = "svc" // Salvadoran Colón
    CurrencySZL Currency = "szl" // Swazi Lilangeni
    CurrencyTHB Currency = "thb" // Thai Baht
    CurrencyTJS Currency = "tjs" // Tajikistani Somoni
    CurrencyTOP Currency = "top" // Tongan Paʻanga
    CurrencyTRY Currency = "try" // Turkish Lira
    CurrencyTTD Currency = "ttd" // Trinidad and Tobago Dollar
    CurrencyTWD Currency = "twd" // New Taiwan Dollar
    CurrencyTZS Currency = "tzs" // Tanzanian Shilling
    CurrencyUAH Currency = "uah" // Ukrainian Hryvnia
    CurrencyUGX Currency = "ugx" // Ugandan Shilling
    CurrencyUSD Currency = "usd" // United States Dollar
    CurrencyUYU Currency = "uyu" // Uruguayan Peso
    CurrencyUZS Currency = "uzs" // Uzbekistani Som
    CurrencyVEF Currency = "vef" // Venezuelan Bolívar
    CurrencyVND Currency = "vnd" // Vietnamese Đồng
    CurrencyVUV Currency = "vuv" // Vanuatu Vatu
    CurrencyWST Currency = "wst" // Samoan Tala
    CurrencyXAF Currency = "xaf" // Central African Cfa Franc
    CurrencyXCD Currency = "xcd" // East Caribbean Dollar
    CurrencyXOF Currency = "xof" // West African Cfa Franc
    CurrencyXPF Currency = "xpf" // Cfp Franc
    CurrencyYER Currency = "yer" // Yemeni Rial
    CurrencyZAR Currency = "zar" // South African Rand
    CurrencyZMW Currency = "zmw" // Zambian Kwacha
)

List of values that Currency can take.

type Customer Uses

type Customer struct {
    Address          Address                  `json:"address"`
    Balance          int64                    `json:"balance"`
    Created          int64                    `json:"created"`
    Currency         Currency                 `json:"currency"`
    DefaultSource    *PaymentSource           `json:"default_source"`
    Deleted          bool                     `json:"deleted"`
    Delinquent       bool                     `json:"delinquent"`
    Description      string                   `json:"description"`
    Discount         *Discount                `json:"discount"`
    Email            string                   `json:"email"`
    ID               string                   `json:"id"`
    InvoicePrefix    string                   `json:"invoice_prefix"`
    InvoiceSettings  *CustomerInvoiceSettings `json:"invoice_settings"`
    Livemode         bool                     `json:"livemode"`
    Metadata         map[string]string        `json:"metadata"`
    Name             string                   `json:"name"`
    Phone            string                   `json:"phone"`
    PreferredLocales []string                 `json:"preferred_locales"`
    Shipping         *CustomerShippingDetails `json:"shipping"`
    Sources          *SourceList              `json:"sources"`
    Subscriptions    *SubscriptionList        `json:"subscriptions"`
    TaxExempt        CustomerTaxExempt        `json:"tax_exempt"`
    TaxIDs           *TaxIDList               `json:"tax_ids"`
}

Customer is the resource representing a Stripe customer. For more details see https://stripe.com/docs/api#customers.

Code:

stripe.Key = "sk_key"

customerDel, err := customer.Del("cus_example_id", nil)

if err != nil {
    log.Fatal(err)
}

if !customerDel.Deleted {
    log.Fatal("Customer doesn't appear deleted while it should be")
}

func (*Customer) UnmarshalJSON Uses

func (c *Customer) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Customer. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CustomerBalanceTransaction Uses

type CustomerBalanceTransaction struct {
    Amount        int64                          `json:"amount"`
    Created       int64                          `json:"created"`
    CreditNote    *CreditNote                    `json:"credit_note"`
    Currency      Currency                       `json:"currency"`
    Customer      *Customer                      `json:"customer"`
    Description   string                         `json:"description"`
    EndingBalance int64                          `json:"ending_balance"`
    ID            string                         `json:"id"`
    Invoice       *Invoice                       `json:"invoice"`
    Livemode      bool                           `json:"livemode"`
    Metadata      map[string]string              `json:"metadata"`
    Object        string                         `json:"object"`
    Type          CustomerBalanceTransactionType `json:"type"`
}

CustomerBalanceTransaction is the resource representing a customer balance transaction. For more details see https://stripe.com/docs/api/customers/customer_balance_transaction_object

func (*CustomerBalanceTransaction) UnmarshalJSON Uses

func (c *CustomerBalanceTransaction) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a CustomerBalanceTransaction. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type CustomerBalanceTransactionList Uses

type CustomerBalanceTransactionList struct {
    ListMeta
    Data []*CustomerBalanceTransaction `json:"data"`
}

CustomerBalanceTransactionList is a list of customer balance transactions as retrieved from a list endpoint.

type CustomerBalanceTransactionListParams Uses

type CustomerBalanceTransactionListParams struct {
    ListParams `form:"*"`
    Customer   *string `form:"-"`
}

CustomerBalanceTransactionListParams is the set of parameters that can be used when listing customer balance transactions. For more detail see https://stripe.com/docs/api/customers/customer_balance_transactions

type CustomerBalanceTransactionParams Uses

type CustomerBalanceTransactionParams struct {
    Params      `form:"*"`
    Amount      *int64  `form:"amount"`
    Customer    *string `form:"-"`
    Currency    *string `form:"currency"`
    Description *string `form:"description"`
}

CustomerBalanceTransactionParams is the set of parameters that can be used when creating or updating a customer balance transactions. For more details see https://stripe.com/docs/api/customers/create_customer_balance_transaction

type CustomerBalanceTransactionType Uses

type CustomerBalanceTransactionType string

CustomerBalanceTransactionType is the list of allowed values for the customer's balance transaction type.

const (
    CustomerBalanceTransactionTypeAdjustment            CustomerBalanceTransactionType = "adjustment"
    CustomerBalanceTransactionTypeAppliedToInvoice      CustomerBalanceTransactionType = "applied_to_invoice"
    CustomerBalanceTransactionTypeCreditNote            CustomerBalanceTransactionType = "credit_note"
    CustomerBalanceTransactionTypeInitial               CustomerBalanceTransactionType = "initial"
    CustomerBalanceTransactionTypeInvoiceTooLarge       CustomerBalanceTransactionType = "invoice_too_large"
    CustomerBalanceTransactionTypeInvoiceTooSmall       CustomerBalanceTransactionType = "invoice_too_small"
    CustomerBalanceTransactionTypeUnspentReceiverCredit CustomerBalanceTransactionType = "unspent_receiver_credit"
)

List of values that CustomerBalanceTransactionDuration can take.

type CustomerInvoiceCustomField Uses

type CustomerInvoiceCustomField struct {
    Name  *string `form:"name"`
    Value *string `form:"value"`
}

CustomerInvoiceCustomField represents a custom field associated with the customer's invoices.

type CustomerInvoiceCustomFieldParams Uses

type CustomerInvoiceCustomFieldParams struct {
    Name  *string `form:"name"`
    Value *string `form:"value"`
}

CustomerInvoiceCustomFieldParams represents the parameters associated with one custom field on the customer's invoices.

type CustomerInvoiceSettings Uses

type CustomerInvoiceSettings struct {
    CustomFields         []*CustomerInvoiceCustomField `json:"custom_fields"`
    DefaultPaymentMethod *PaymentMethod                `json:"default_payment_method"`
    Footer               string                        `json:"footer"`
}

CustomerInvoiceSettings is the structure containing the default settings for invoices associated with this customer.

type CustomerInvoiceSettingsParams Uses

type CustomerInvoiceSettingsParams struct {
    CustomFields         []*CustomerInvoiceCustomFieldParams `form:"custom_fields"`
    DefaultPaymentMethod *string                             `form:"default_payment_method"`
    Footer               *string                             `form:"footer"`
}

CustomerInvoiceSettingsParams is the structure containing the default settings for invoices associated with this customer.

type CustomerList Uses

type CustomerList struct {
    ListMeta
    Data []*Customer `json:"data"`
}

CustomerList is a list of customers as retrieved from a list endpoint.

type CustomerListParams Uses

type CustomerListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Email        *string           `form:"email"`
}

CustomerListParams is the set of parameters that can be used when listing customers. For more details see https://stripe.com/docs/api#list_customers.

type CustomerParams Uses

type CustomerParams struct {
    Params           `form:"*"`
    Address          *AddressParams                 `form:"address"`
    Balance          *int64                         `form:"balance"`
    Coupon           *string                        `form:"coupon"`
    DefaultSource    *string                        `form:"default_source"`
    Description      *string                        `form:"description"`
    Email            *string                        `form:"email"`
    InvoicePrefix    *string                        `form:"invoice_prefix"`
    InvoiceSettings  *CustomerInvoiceSettingsParams `form:"invoice_settings"`
    Name             *string                        `form:"name"`
    PaymentMethod    *string                        `form:"payment_method"`
    Phone            *string                        `form:"phone"`
    PreferredLocales []*string                      `form:"preferred_locales"`
    Shipping         *CustomerShippingDetailsParams `form:"shipping"`
    Source           *SourceParams                  `form:"*"` // SourceParams has custom encoding so brought to top level with "*"
    TaxExempt        *string                        `form:"tax_exempt"`
    TaxIDData        []*CustomerTaxIDDataParams     `form:"tax_id_data"`
    Token            *string                        `form:"-"` // This doesn't seem to be used?

    // The parameters below are considered deprecated. Consider creating a Subscription separately instead.
    Plan       *string  `form:"plan"`
    Quantity   *int64   `form:"quantity"`
    TaxPercent *float64 `form:"tax_percent"`
    TrialEnd   *int64   `form:"trial_end"`
}

CustomerParams is the set of parameters that can be used when creating or updating a customer. For more details see https://stripe.com/docs/api#create_customer and https://stripe.com/docs/api#update_customer.

func (*CustomerParams) SetSource Uses

func (cp *CustomerParams) SetSource(sp interface{}) error

SetSource adds valid sources to a CustomerParams object, returning an error for unsupported sources.

type CustomerShippingDetails Uses

type CustomerShippingDetails struct {
    Address Address `json:"address"`
    Name    string  `json:"name"`
    Phone   string  `json:"phone"`
}

CustomerShippingDetails is the structure containing shipping information.

type CustomerShippingDetailsParams Uses

type CustomerShippingDetailsParams struct {
    Address *AddressParams `form:"address"`
    Name    *string        `form:"name"`
    Phone   *string        `form:"phone"`
}

CustomerShippingDetailsParams is the structure containing shipping information.

type CustomerSourceParams Uses

type CustomerSourceParams struct {
    Params   `form:"*"`
    Customer *string       `form:"-"` // Goes in the URL
    Source   *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*"
}

CustomerSourceParams are used to manipulate a given Stripe Customer object's payment sources. For more details see https://stripe.com/docs/api#sources

func (*CustomerSourceParams) SetSource Uses

func (cp *CustomerSourceParams) SetSource(sp interface{}) error

SetSource adds valid sources to a CustomerSourceParams object, returning an error for unsupported sources.

type CustomerTaxExempt Uses

type CustomerTaxExempt string

CustomerTaxExempt is the type of tax exemption associated with a customer.

const (
    CustomerTaxExemptExempt  CustomerTaxExempt = "exempt"
    CustomerTaxExemptNone    CustomerTaxExempt = "none"
    CustomerTaxExemptReverse CustomerTaxExempt = "reverse"
)

List of values that CustomerTaxExempt can take.

type CustomerTaxIDDataParams Uses

type CustomerTaxIDDataParams struct {
    Type  *string `form:"type"`
    Value *string `form:"value"`
}

CustomerTaxIDDataParams lets you pass the tax id details associated with a Customer.

type DOB Uses

type DOB struct {
    Day   int64 `json:"day"`
    Month int64 `json:"month"`
    Year  int64 `json:"year"`
}

DOB represents a Person's date of birth.

type DOBParams Uses

type DOBParams struct {
    Day   *int64 `form:"day"`
    Month *int64 `form:"month"`
    Year  *int64 `form:"year"`
}

DOBParams represents a DOB during account creation/updates.

type Deauthorize Uses

type Deauthorize struct {
    StripeUserID string `json:"stripe_user_id"`
}

Deauthorize is the value of the return from deauthorizing. https://stripe.com/docs/connect/oauth-reference#post-deauthorize

type DeauthorizeParams Uses

type DeauthorizeParams struct {
    Params       `form:"*"`
    ClientID     *string `form:"client_id"`
    StripeUserID *string `form:"stripe_user_id"`
}

DeauthorizeParams for deauthorizing an account.

type DeclineCode Uses

type DeclineCode string

DeclineCode is the list of reasons provided by card issuers for decline of payment.

const (
    DeclineCodeAuthenticationRequired         DeclineCode = "authentication_required"
    DeclineCodeApproveWithID                  DeclineCode = "approve_with_id"
    DeclineCodeCallIssuer                     DeclineCode = "call_issuer"
    DeclineCodeCardNotSupported               DeclineCode = "card_not_supported"
    DeclineCodeCardVelocityExceeded           DeclineCode = "card_velocity_exceeded"
    DeclineCodeCurrencyNotSupported           DeclineCode = "currency_not_supported"
    DeclineCodeDoNotHonor                     DeclineCode = "do_not_honor"
    DeclineCodeDoNotTryAgain                  DeclineCode = "do_not_try_again"
    DeclineCodeDuplicateTransaction           DeclineCode = "duplicate_transaction"
    DeclineCodeExpiredCard                    DeclineCode = "expired_card"
    DeclineCodeFraudulent                     DeclineCode = "fraudulent"
    DeclineCodeGenericDecline                 DeclineCode = "generic_decline"
    DeclineCodeIncorrectNumber                DeclineCode = "incorrect_number"
    DeclineCodeIncorrectCVC                   DeclineCode = "incorrect_cvc"
    DeclineCodeIncorrectPIN                   DeclineCode = "incorrect_pin"
    DeclineCodeIncorrectZip                   DeclineCode = "incorrect_zip"
    DeclineCodeInsufficientFunds              DeclineCode = "insufficient_funds"
    DeclineCodeInvalidAccount                 DeclineCode = "invalid_account"
    DeclineCodeInvalidAmount                  DeclineCode = "invalid_amount"
    DeclineCodeInvalidCVC                     DeclineCode = "invalid_cvc"
    DeclineCodeInvalidExpiryYear              DeclineCode = "invalid_expiry_year"
    DeclineCodeInvalidNumber                  DeclineCode = "invalid_number"
    DeclineCodeInvalidPIN                     DeclineCode = "invalid_pin"
    DeclineCodeIssuerNotAvailable             DeclineCode = "issuer_not_available"
    DeclineCodeLostCard                       DeclineCode = "lost_card"
    DeclineCodeMerchantBlacklist              DeclineCode = "merchant_blacklist"
    DeclineCodeNewAccountInformationAvailable DeclineCode = "new_account_information_available"
    DeclineCodeNoActionTaken                  DeclineCode = "no_action_taken"
    DeclineCodeNotPermitted                   DeclineCode = "not_permitted"
    DeclineCodePickupCard                     DeclineCode = "pickup_card"
    DeclineCodePINTryExceeded                 DeclineCode = "pin_try_exceeded"
    DeclineCodeProcessingError                DeclineCode = "processing_error"
    DeclineCodeReenterTransaction             DeclineCode = "reenter_transaction"
    DeclineCodeRestrictedCard                 DeclineCode = "restricted_card"
    DeclineCodeRevocationOfAllAuthorizations  DeclineCode = "revocation_of_all_authorizations"
    DeclineCodeRevocationOfAuthorization      DeclineCode = "revocation_of_authorization"
    DeclineCodeSecurityViolation              DeclineCode = "security_violation"
    DeclineCodeServiceNotAllowed              DeclineCode = "service_not_allowed"
    DeclineCodeStolenCard                     DeclineCode = "stolen_card"
    DeclineCodeStopPaymentOrder               DeclineCode = "stop_payment_order"
    DeclineCodeTestModeDecline                DeclineCode = "testmode_decline"
    DeclineCodeTransactionNotAllowed          DeclineCode = "transaction_not_allowed"
    DeclineCodeTryAgainLater                  DeclineCode = "try_again_later"
    DeclineCodeWithdrawalCountLimitExceeded   DeclineCode = "withdrawal_count_limit_exceeded"
)

List of DeclineCode values.

type DeliveryEstimate Uses

type DeliveryEstimate struct {
    // If Type == Exact
    Date string `json:"date"`
    // If Type == Range
    Earliest string                    `json:"earliest"`
    Latest   string                    `json:"latest"`
    Type     OrderDeliveryEstimateType `json:"type"`
}

DeliveryEstimate represent the properties available for a shipping method's estimated delivery.

type DestinationParams Uses

type DestinationParams struct {
    Account *string `form:"account"`
    Amount  *int64  `form:"amount"`
}

DestinationParams describes the parameters available for the destination hash when creating a charge.

type Discount Uses

type Discount struct {
    Coupon       *Coupon `json:"coupon"`
    Customer     string  `json:"customer"`
    Deleted      bool    `json:"deleted"`
    End          int64   `json:"end"`
    Start        int64   `json:"start"`
    Subscription string  `json:"subscription"`
}

Discount is the resource representing a Stripe discount. For more details see https://stripe.com/docs/api#discounts.

type DiscountParams Uses

type DiscountParams struct {
    Params `form:"*"`
}

DiscountParams is the set of parameters that can be used when deleting a discount.

type Dispute Uses

type Dispute struct {
    Amount              int64                 `json:"amount"`
    BalanceTransactions []*BalanceTransaction `json:"balance_transactions"`
    Charge              *Charge               `json:"charge"`
    Created             int64                 `json:"created"`
    Currency            Currency              `json:"currency"`
    Evidence            *DisputeEvidence      `json:"evidence"`
    EvidenceDetails     *EvidenceDetails      `json:"evidence_details"`
    ID                  string                `json:"id"`
    IsChargeRefundable  bool                  `json:"is_charge_refundable"`
    Livemode            bool                  `json:"livemode"`
    Metadata            map[string]string     `json:"metadata"`
    PaymentIntent       *PaymentIntent        `json:"payment_intent"`
    Reason              DisputeReason         `json:"reason"`
    Status              DisputeStatus         `json:"status"`
}

Dispute is the resource representing a Stripe dispute. For more details see https://stripe.com/docs/api#disputes.

func (*Dispute) UnmarshalJSON Uses

func (d *Dispute) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Dispute. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type DisputeEvidence Uses

type DisputeEvidence struct {
    AccessActivityLog            string `json:"access_activity_log"`
    BillingAddress               string `json:"billing_address"`
    CancellationPolicy           *File  `json:"cancellation_policy"`
    CancellationPolicyDisclosure string `json:"cancellation_policy_disclosure"`
    CancellationRebuttal         string `json:"cancellation_rebuttal"`
    CustomerCommunication        *File  `json:"customer_communication"`
    CustomerEmailAddress         string `json:"customer_email_address"`
    CustomerName                 string `json:"customer_name"`
    CustomerPurchaseIP           string `json:"customer_purchase_ip"`
    CustomerSignature            *File  `json:"customer_signature"`
    DuplicateChargeDocumentation *File  `json:"duplicate_charge_documentation"`
    DuplicateChargeExplanation   string `json:"duplicate_charge_explanation"`
    DuplicateChargeID            string `json:"duplicate_charge_id"`
    ProductDescription           string `json:"product_description"`
    Receipt                      *File  `json:"receipt"`
    RefundPolicy                 *File  `json:"refund_policy"`
    RefundPolicyDisclosure       string `json:"refund_policy_disclosure"`
    RefundRefusalExplanation     string `json:"refund_refusal_explanation"`
    ServiceDate                  string `json:"service_date"`
    ServiceDocumentation         *File  `json:"service_documentation"`
    ShippingAddress              string `json:"shipping_address"`
    ShippingCarrier              string `json:"shipping_carrier"`
    ShippingDate                 string `json:"shipping_date"`
    ShippingDocumentation        *File  `json:"shipping_documentation"`
    ShippingTrackingNumber       string `json:"shipping_tracking_number"`
    UncategorizedFile            *File  `json:"uncategorized_file"`
    UncategorizedText            string `json:"uncategorized_text"`
}

DisputeEvidence is the structure that contains various details about the evidence submitted for the dispute. Almost all fields are strings since there structures (i.e. address) do not typically get parsed by anyone and are thus presented as-received.

type DisputeEvidenceParams Uses

type DisputeEvidenceParams struct {
    AccessActivityLog            *string `form:"access_activity_log"`
    BillingAddress               *string `form:"billing_address"`
    CancellationPolicy           *string `form:"cancellation_policy"`
    CancellationPolicyDisclosure *string `form:"cancellation_policy_disclosure"`
    CancellationRebuttal         *string `form:"cancellation_rebuttal"`
    CustomerCommunication        *string `form:"customer_communication"`
    CustomerEmailAddress         *string `form:"customer_email_address"`
    CustomerName                 *string `form:"customer_name"`
    CustomerPurchaseIP           *string `form:"customer_purchase_ip"`
    CustomerSignature            *string `form:"customer_signature"`
    DuplicateChargeDocumentation *string `form:"duplicate_charge_documentation"`
    DuplicateChargeExplanation   *string `form:"duplicate_charge_explanation"`
    DuplicateChargeID            *string `form:"duplicate_charge_id"`
    ProductDescription           *string `form:"product_description"`
    Receipt                      *string `form:"receipt"`
    RefundPolicy                 *string `form:"refund_policy"`
    RefundPolicyDisclosure       *string `form:"refund_policy_disclosure"`
    RefundRefusalExplanation     *string `form:"refund_refusal_explanation"`
    ServiceDate                  *string `form:"service_date"`
    ServiceDocumentation         *string `form:"service_documentation"`
    ShippingAddress              *string `form:"shipping_address"`
    ShippingCarrier              *string `form:"shipping_carrier"`
    ShippingDate                 *string `form:"shipping_date"`
    ShippingDocumentation        *string `form:"shipping_documentation"`
    ShippingTrackingNumber       *string `form:"shipping_tracking_number"`
    UncategorizedFile            *string `form:"uncategorized_file"`
    UncategorizedText            *string `form:"uncategorized_text"`
}

DisputeEvidenceParams is the set of parameters that can be used when submitting evidence for disputes.

type DisputeList Uses

type DisputeList struct {
    ListMeta
    Data []*Dispute `json:"data"`
}

DisputeList is a list of disputes as retrieved from a list endpoint.

type DisputeListParams Uses

type DisputeListParams struct {
    ListParams   `form:"*"`
    Charge       *string           `form:"charge"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
}

DisputeListParams is the set of parameters that can be used when listing disputes. For more details see https://stripe.com/docs/api#list_disputes.

type DisputeParams Uses

type DisputeParams struct {
    Params   `form:"*"`
    Evidence *DisputeEvidenceParams `form:"evidence"`
    Submit   *bool                  `form:"submit"`
}

DisputeParams is the set of parameters that can be used when updating a dispute. For more details see https://stripe.com/docs/api#update_dispute.

type DisputeReason Uses

type DisputeReason string

DisputeReason is the list of allowed values for a discount's reason.

const (
    DisputeReasonCreditNotProcessed   DisputeReason = "credit_not_processed"
    DisputeReasonDuplicate            DisputeReason = "duplicate"
    DisputeReasonFraudulent           DisputeReason = "fraudulent"
    DisputeReasonGeneral              DisputeReason = "general"
    DisputeReasonProductNotReceived   DisputeReason = "product_not_received"
    DisputeReasonProductUnacceptable  DisputeReason = "product_unacceptable"
    DisputeReasonSubscriptionCanceled DisputeReason = "subscription_canceled"
    DisputeReasonUnrecognized         DisputeReason = "unrecognized"
)

List of values that DisputeReason can take.

type DisputeStatus Uses

type DisputeStatus string

DisputeStatus is the list of allowed values for a discount's status.

const (
    DisputeStatusChargeRefunded       DisputeStatus = "charge_refunded"
    DisputeStatusLost                 DisputeStatus = "lost"
    DisputeStatusNeedsResponse        DisputeStatus = "needs_response"
    DisputeStatusUnderReview          DisputeStatus = "under_review"
    DisputeStatusWarningClosed        DisputeStatus = "warning_closed"
    DisputeStatusWarningNeedsResponse DisputeStatus = "warning_needs_response"
    DisputeStatusWarningUnderReview   DisputeStatus = "warning_under_review"
    DisputeStatusWon                  DisputeStatus = "won"
)

List of values that DisputeStatus can take.

type EphemeralKey Uses

type EphemeralKey struct {
    AssociatedObjects []struct {
        ID   string `json:"id"`
        Type string `json:"type"`
    }   `json:"associated_objects"`

    Created  int64  `json:"created"`
    Expires  int64  `json:"expires"`
    ID       string `json:"id"`
    Livemode bool   `json:"livemode"`

    // RawJSON is provided so that it may be passed back to the frontend
    // unchanged.  Ephemeral keys are issued on behalf of another client which
    // may be running a different version of the bindings and thus expect a
    // different JSON structure.  This ensures that if the structure differs
    // from the version of these bindings, we can still pass back a compatible
    // key.
    RawJSON []byte `json:"-"`
}

EphemeralKey is the resource representing a Stripe ephemeral key. This is used by Mobile SDKs to for example manage a Customer's payment methods.

func (*EphemeralKey) UnmarshalJSON Uses

func (e *EphemeralKey) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an EphemeralKey. This custom unmarshaling is needed because we need to store the raw JSON on the object so it may be passed back to the frontend.

type EphemeralKeyParams Uses

type EphemeralKeyParams struct {
    Params        `form:"*"`
    Customer      *string `form:"customer"`
    IssuingCard   *string `form:"issuing_card"`
    StripeVersion *string `form:"-"` // This goes in the `Stripe-Version` header
}

EphemeralKeyParams is the set of parameters that can be used when creating an ephemeral key.

type Error Uses

type Error struct {
    ChargeID    string      `json:"charge,omitempty"`
    Code        ErrorCode   `json:"code,omitempty"`
    DeclineCode DeclineCode `json:"decline_code,omitempty"`
    DocURL      string      `json:"doc_url,omitempty"`

    // Err contains an internal error with an additional level of granularity
    // that can be used in some cases to get more detailed information about
    // what went wrong. For example, Err may hold a CardError that indicates
    // exactly what went wrong during charging a card.
    Err error `json:"-"`

    HTTPStatusCode int            `json:"status,omitempty"`
    Msg            string         `json:"message"`
    Param          string         `json:"param,omitempty"`
    PaymentIntent  *PaymentIntent `json:"payment_intent,omitempty"`
    PaymentMethod  *PaymentMethod `json:"payment_method,omitempty"`
    RequestID      string         `json:"request_id,omitempty"`
    SetupIntent    *SetupIntent   `json:"setup_intent,omitempty"`
    Source         *PaymentSource `json:"source,omitempty"`
    Type           ErrorType      `json:"type"`

    // OAuth specific Error properties. Named OAuthError because of name conflict.
    OAuthError            string `json:"error,omitempty"`
    OAuthErrorDescription string `json:"error_description,omitempty"`
}

Error is the response returned when a call is unsuccessful. For more details see https://stripe.com/docs/api#errors.

func (*Error) Error Uses

func (e *Error) Error() string

Error serializes the error object to JSON and returns it as a string.

type ErrorCode Uses

type ErrorCode string

ErrorCode is the list of allowed values for the error's code.

const (
    ErrorCodeAccountAlreadyExists                   ErrorCode = "account_already_exists"
    ErrorCodeAccountCountryInvalidAddress           ErrorCode = "account_country_invalid_address"
    ErrorCodeAccountInvalid                         ErrorCode = "account_invalid"
    ErrorCodeAccountNumberInvalid                   ErrorCode = "account_number_invalid"
    ErrorCodeAlipayUpgradeRequired                  ErrorCode = "alipay_upgrade_required"
    ErrorCodeAmountTooLarge                         ErrorCode = "amount_too_large"
    ErrorCodeAmountTooSmall                         ErrorCode = "amount_too_small"
    ErrorCodeAPIKeyExpired                          ErrorCode = "api_key_expired"
    ErrorCodeAuthenticationRequired                 ErrorCode = "authentication_required"
    ErrorCodeBalanceInsufficient                    ErrorCode = "balance_insufficient"
    ErrorCodeBankAccountExists                      ErrorCode = "bank_account_exists"
    ErrorCodeBankAccountUnusable                    ErrorCode = "bank_account_unusable"
    ErrorCodeBankAccountUnverified                  ErrorCode = "bank_account_unverified"
    ErrorCodeBitcoinUpgradeRequired                 ErrorCode = "bitcoin_upgrade_required"
    ErrorCodeCardDeclined                           ErrorCode = "card_declined"
    ErrorCodeChargeAlreadyCaptured                  ErrorCode = "charge_already_captured"
    ErrorCodeChargeAlreadyRefunded                  ErrorCode = "charge_already_refunded"
    ErrorCodeChargeDisputed                         ErrorCode = "charge_disputed"
    ErrorCodeChargeExceedsSourceLimit               ErrorCode = "charge_exceeds_source_limit"
    ErrorCodeChargeExpiredForCapture                ErrorCode = "charge_expired_for_capture"
    ErrorCodeCountryUnsupported                     ErrorCode = "country_unsupported"
    ErrorCodeCouponExpired                          ErrorCode = "coupon_expired"
    ErrorCodeCustomerMaxSubscriptions               ErrorCode = "customer_max_subscriptions"
    ErrorCodeEmailInvalid                           ErrorCode = "email_invalid"
    ErrorCodeExpiredCard                            ErrorCode = "expired_card"
    ErrorCodeIdempotencyKeyInUse                    ErrorCode = "idempotency_key_in_use"
    ErrorCodeIncorrectAddress                       ErrorCode = "incorrect_address"
    ErrorCodeIncorrectCVC                           ErrorCode = "incorrect_cvc"
    ErrorCodeIncorrectNumber                        ErrorCode = "incorrect_number"
    ErrorCodeIncorrectZip                           ErrorCode = "incorrect_zip"
    ErrorCodeInstantPayoutsUnsupported              ErrorCode = "instant_payouts_unsupported"
    ErrorCodeInvalidCardType                        ErrorCode = "invalid_card_type"
    ErrorCodeInvalidChargeAmount                    ErrorCode = "invalid_charge_amount"
    ErrorCodeInvalidCVC                             ErrorCode = "invalid_cvc"
    ErrorCodeInvalidExpiryMonth                     ErrorCode = "invalid_expiry_month"
    ErrorCodeInvalidExpiryYear                      ErrorCode = "invalid_expiry_year"
    ErrorCodeInvalidNumber                          ErrorCode = "invalid_number"
    ErrorCodeInvalidSourceUsage                     ErrorCode = "invalid_source_usage"
    ErrorCodeInvoiceNoCustomerLineItems             ErrorCode = "invoice_no_customer_line_items"
    ErrorCodeInvoiceNoSubscriptionLineItems         ErrorCode = "invoice_no_subscription_line_items"
    ErrorCodeInvoiceNotEditable                     ErrorCode = "invoice_not_editable"
    ErrorCodeInvoiceUpcomingNone                    ErrorCode = "invoice_upcoming_none"
    ErrorCodeLivemodeMismatch                       ErrorCode = "livemode_mismatch"
    ErrorCodeLockTimeout                            ErrorCode = "lock_timeout"
    ErrorCodeMissing                                ErrorCode = "missing"
    ErrorCodeNotAllowedOnStandardAccount            ErrorCode = "not_allowed_on_standard_account"
    ErrorCodeOrderCreationFailed                    ErrorCode = "order_creation_failed"
    ErrorCodeOrderRequiredSettings                  ErrorCode = "order_required_settings"
    ErrorCodeOrderStatusInvalid                     ErrorCode = "order_status_invalid"
    ErrorCodeOrderUpstreamTimeout                   ErrorCode = "order_upstream_timeout"
    ErrorCodeOutOfInventory                         ErrorCode = "out_of_inventory"
    ErrorCodeParameterInvalidEmpty                  ErrorCode = "parameter_invalid_empty"
    ErrorCodeParameterInvalidInteger                ErrorCode = "parameter_invalid_integer"
    ErrorCodeParameterInvalidStringBlank            ErrorCode = "parameter_invalid_string_blank"
    ErrorCodeParameterInvalidStringEmpty            ErrorCode = "parameter_invalid_string_empty"
    ErrorCodeParameterMissing                       ErrorCode = "parameter_missing"
    ErrorCodeParameterUnknown                       ErrorCode = "parameter_unknown"
    ErrorCodeParametersExclusive                    ErrorCode = "parameters_exclusive"
    ErrorCodePaymentIntentAuthenticationFailure     ErrorCode = "payment_intent_authentication_failure"
    ErrorCodePaymentIntentIncompatiblePaymentMethod ErrorCode = "payment_intent_incompatible_payment_method"
    ErrorCodePaymentIntentInvalidParameter          ErrorCode = "payment_intent_invalid_parameter"
    ErrorCodePaymentIntentPaymentAttemptFailed      ErrorCode = "payment_intent_payment_attempt_failed"
    ErrorCodePaymentIntentUnexpectedState           ErrorCode = "payment_intent_unexpected_state"
    ErrorCodePaymentMethodUnactivated               ErrorCode = "payment_method_unactivated"
    ErrorCodePaymentMethodUnexpectedState           ErrorCode = "payment_method_unexpected_state"
    ErrorCodePayoutsNotAllowed                      ErrorCode = "payouts_not_allowed"
    ErrorCodePlatformAPIKeyExpired                  ErrorCode = "platform_api_key_expired"
    ErrorCodePostalCodeInvalid                      ErrorCode = "postal_code_invalid"
    ErrorCodeProcessingError                        ErrorCode = "processing_error"
    ErrorCodeProductInactive                        ErrorCode = "product_inactive"
    ErrorCodeRateLimit                              ErrorCode = "rate_limit"
    ErrorCodeResourceAlreadyExists                  ErrorCode = "resource_already_exists"
    ErrorCodeResourceMissing                        ErrorCode = "resource_missing"
    ErrorCodeRoutingNumberInvalid                   ErrorCode = "routing_number_invalid"
    ErrorCodeSecretKeyRequired                      ErrorCode = "secret_key_required"
    ErrorCodeSepaUnsupportedAccount                 ErrorCode = "sepa_unsupported_account"
    ErrorCodeSetupAttemptFailed                     ErrorCode = "setup_attempt_failed"
    ErrorCodeSetupIntentAuthenticationFailure       ErrorCode = "setup_intent_authentication_failure"
    ErrorCodeSetupIntentUnexpectedState             ErrorCode = "setup_intent_unexpected_state"
    ErrorCodeShippingCalculationFailed              ErrorCode = "shipping_calculation_failed"
    ErrorCodeSkuInactive                            ErrorCode = "sku_inactive"
    ErrorCodeStateUnsupported                       ErrorCode = "state_unsupported"
    ErrorCodeTaxIDInvalid                           ErrorCode = "tax_id_invalid"
    ErrorCodeTaxesCalculationFailed                 ErrorCode = "taxes_calculation_failed"
    ErrorCodeTestmodeChargesOnly                    ErrorCode = "testmode_charges_only"
    ErrorCodeTLSVersionUnsupported                  ErrorCode = "tls_version_unsupported"
    ErrorCodeTokenAlreadyUsed                       ErrorCode = "token_already_used"
    ErrorCodeTokenInUse                             ErrorCode = "token_in_use"
    ErrorCodeTransfersNotAllowed                    ErrorCode = "transfers_not_allowed"
    ErrorCodeUpstreamOrderCreationFailed            ErrorCode = "upstream_order_creation_failed"
    ErrorCodeURLInvalid                             ErrorCode = "url_invalid"

    // The following error code can be returned though is undocumented
    ErrorCodeInvalidSwipeData ErrorCode = "invalid_swipe_data"
)

List of values that ErrorCode can take.

type ErrorType Uses

type ErrorType string

ErrorType is the list of allowed values for the error's type.

const (
    ErrorTypeAPI            ErrorType = "api_error"
    ErrorTypeAPIConnection  ErrorType = "api_connection_error"
    ErrorTypeAuthentication ErrorType = "authentication_error"
    ErrorTypeCard           ErrorType = "card_error"
    ErrorTypeInvalidRequest ErrorType = "invalid_request_error"
    ErrorTypePermission     ErrorType = "more_permissions_required"
    ErrorTypeRateLimit      ErrorType = "rate_limit_error"
)

List of values that ErrorType can take.

type Event Uses

type Event struct {
    Account         string        `json:"account"`
    Created         int64         `json:"created"`
    Data            *EventData    `json:"data"`
    ID              string        `json:"id"`
    Livemode        bool          `json:"livemode"`
    PendingWebhooks int64         `json:"pending_webhooks"`
    Request         *EventRequest `json:"request"`
    Type            string        `json:"type"`
}

Event is the resource representing a Stripe event. For more details see https://stripe.com/docs/api#events.

func (*Event) GetObjectValue Uses

func (e *Event) GetObjectValue(keys ...string) string

GetObjectValue returns the value from the e.Data.Object bag based on the keys hierarchy.

func (*Event) GetPreviousValue Uses

func (e *Event) GetPreviousValue(keys ...string) string

GetPreviousValue returns the value from the e.Data.Prev bag based on the keys hierarchy.

type EventData Uses

type EventData struct {
    // Object is a raw mapping of the API resource contained in the event.
    // Although marked with json:"-", it's still populated independently by
    // a custom UnmarshalJSON implementation.
    Object             map[string]interface{} `json:"-"`
    PreviousAttributes map[string]interface{} `json:"previous_attributes"`
    Raw                json.RawMessage        `json:"object"`
}

EventData is the unmarshalled object as a map.

func (*EventData) UnmarshalJSON Uses

func (e *EventData) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of the EventData. This custom unmarshaling exists so that we can keep both the map and raw data.

type EventList Uses

type EventList struct {
    ListMeta
    Data []*Event `json:"data"`
}

EventList is a list of events as retrieved from a list endpoint.

type EventListParams Uses

type EventListParams struct {
    ListParams      `form:"*"`
    Created         *int64            `form:"created"`
    CreatedRange    *RangeQueryParams `form:"created"`
    DeliverySuccess *bool             `form:"delivery_success"`
    Type            *string           `form:"type"`
    Types           []*string         `form:"types"`
}

EventListParams is the set of parameters that can be used when listing events. For more details see https://stripe.com/docs/api#list_events.

type EventParams Uses

type EventParams struct {
    Params `form:"*"`
}

EventParams is the set of parameters that can be used when retrieving events. For more details see https://stripe.com/docs/api#retrieve_events.

type EventRequest Uses

type EventRequest struct {
    // ID is the request ID of the request that created an event, if the event
    // was created by a request.
    ID  string `json:"id"`

    // IdempotencyKey is the idempotency key of the request that created an
    // event, if the event was created by a request and if an idempotency key
    // was specified for that request.
    IdempotencyKey string `json:"idempotency_key"`
}

EventRequest contains information on a request that created an event.

type EvidenceDetails Uses

type EvidenceDetails struct {
    DueBy           int64 `json:"due_by"`
    HasEvidence     bool  `json:"has_evidence"`
    PastDue         bool  `json:"past_due"`
    SubmissionCount int64 `json:"submission_count"`
}

EvidenceDetails is the structure representing more details about the dispute.

type ExchangeRate Uses

type ExchangeRate struct {
    ID    string               `json:"id"`
    Rates map[Currency]float64 `json:"rates"`
}

ExchangeRate is the resource representing the currency exchange rates at a given time.

type ExchangeRateList Uses

type ExchangeRateList struct {
    ListMeta
    Data []*ExchangeRate `json:"data"`
}

ExchangeRateList is a list of exchange rates as retrieved from a list endpoint.

type ExchangeRateListParams Uses

type ExchangeRateListParams struct {
    ListParams `form:"*"`
}

ExchangeRateListParams are the parameters allowed during ExchangeRate listing.

type ExchangeRateParams Uses

type ExchangeRateParams struct {
    Params `form:"*"`
}

ExchangeRateParams is the set of parameters that can be used when retrieving exchange rates.

type ExternalAccount Uses

type ExternalAccount struct {
    // BankAccount is a bank account attached to an account. Populated only if
    // the external account is a bank account.
    BankAccount *BankAccount

    // Card is a card attached to an account. Populated only if the external
    // account is a card.
    Card *Card

    ID   string              `json:"id"`
    Type ExternalAccountType `json:"object"`
}

ExternalAccount is an external account (a bank account or card) that's attached to an account. It contains fields that will be conditionally populated depending on its type.

func (*ExternalAccount) UnmarshalJSON Uses

func (ea *ExternalAccount) UnmarshalJSON(data []byte) error

UnmarshalJSON implements Unmarshaler.UnmarshalJSON.

type ExternalAccountList Uses

type ExternalAccountList struct {
    ListMeta

    // Values contains any external accounts (bank accounts and/or cards)
    // currently attached to this account.
    Data []*ExternalAccount `json:"data"`
}

ExternalAccountList is a list of external accounts that may be either bank accounts or cards.

type ExternalAccountType Uses

type ExternalAccountType string

ExternalAccountType is the type of an external account.

const (
    ExternalAccountTypeBankAccount ExternalAccountType = "bank_account"
    ExternalAccountTypeCard        ExternalAccountType = "card"
)

List of values that ExternalAccountType can take.

type ExtraValues Uses

type ExtraValues struct {
    url.Values `form:"-"` // See custom AppendTo implementation
}

ExtraValues are extra parameters that are attached to an API request. They're implemented as a custom type so that they can have their own AppendTo implementation.

func (ExtraValues) AppendTo Uses

func (v ExtraValues) AppendTo(body *form.Values, keyParts []string)

AppendTo implements custom form encoding for extra parameter values.

type FeeRefund Uses

type FeeRefund struct {
    Amount             int64               `json:"amount"`
    BalanceTransaction *BalanceTransaction `json:"balance_transaction"`
    Created            int64               `json:"created"`
    Currency           Currency            `json:"currency"`
    Fee                *ApplicationFee     `json:"fee"`
    ID                 string              `json:"id"`
    Metadata           map[string]string   `json:"metadata"`
}

FeeRefund is the resource representing a Stripe application fee refund. For more details see https://stripe.com/docs/api#fee_refunds.

func (*FeeRefund) UnmarshalJSON Uses

func (r *FeeRefund) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a FeeRefund. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type FeeRefundList Uses

type FeeRefundList struct {
    ListMeta
    Data []*FeeRefund `json:"data"`
}

FeeRefundList is a list object for application fee refunds.

type FeeRefundListParams Uses

type FeeRefundListParams struct {
    ListParams     `form:"*"`
    ApplicationFee *string `form:"-"` // Included in the URL
}

FeeRefundListParams is the set of parameters that can be used when listing application fee refunds. For more details see https://stripe.com/docs/api#list_fee_refunds.

type FeeRefundParams Uses

type FeeRefundParams struct {
    Params         `form:"*"`
    Amount         *int64  `form:"amount"`
    ApplicationFee *string `form:"-"` // Included in the URL
}

FeeRefundParams is the set of parameters that can be used when refunding an application fee. For more details see https://stripe.com/docs/api#fee_refund.

type File Uses

type File struct {
    Created  int64         `json:"created"`
    ID       string        `json:"id"`
    Filename string        `json:"filename"`
    Links    *FileLinkList `json:"links"`
    Purpose  FilePurpose   `json:"purpose"`
    Size     int64         `json:"size"`
    Type     string        `json:"type"`
    URL      string        `json:"url"`
}

File is the resource representing a Stripe file. For more details see https://stripe.com/docs/api#file_object.

func (*File) UnmarshalJSON Uses

func (f *File) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a File. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type FileFileLinkDataParams Uses

type FileFileLinkDataParams struct {
    Params    `form:"*"`
    Create    *bool  `form:"create"`
    ExpiresAt *int64 `form:"expires_at"`
}

FileFileLinkDataParams is the set of parameters allowed for the file_link_data hash.

type FileLink struct {
    Created   int64             `json:"created"`
    Expired   bool              `json:"expired"`
    ExpiresAt int64             `json:"expires_at"`
    File      *File             `json:"file"`
    ID        string            `json:"id"`
    Livemode  bool              `json:"livemode"`
    Metadata  map[string]string `json:"metadata"`
    Object    string            `json:"object"`
    URL       string            `json:"url"`
}

FileLink is the resource representing a Stripe file link. For more details see https://stripe.com/docs/api#file_links.

func (*FileLink) UnmarshalJSON Uses

func (c *FileLink) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a file link. This custom unmarshaling is needed because the resulting property may be an ID or the full struct if it was expanded.

type FileLinkList struct {
    ListMeta
    Data []*FileLink `json:"data"`
}

FileLinkList is a list of file links as retrieved from a list endpoint.

type FileLinkListParams Uses

type FileLinkListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Expired      *bool             `form:"expired"`
    File         *string           `form:"file"`
}

FileLinkListParams is the set of parameters that can be used when listing file links.

type FileLinkParams Uses

type FileLinkParams struct {
    Params    `form:"*"`
    ExpiresAt *int64  `form:"expires_at"`
    File      *string `form:"file"`
}

FileLinkParams is the set of parameters that can be used when creating or updating a file link.

type FileList Uses

type FileList struct {
    ListMeta
    Data []*File `json:"data"`
}

FileList is a list of files as retrieved from a list endpoint.

type FileListParams Uses

type FileListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Purpose      *string           `form:"purpose"`
}

FileListParams is the set of parameters that can be used when listing files. For more details see https://stripe.com/docs/api#list_files.

type FileParams Uses

type FileParams struct {
    Params `form:"*"`

    // FileReader is a reader with the contents of the file that should be uploaded.
    FileReader io.Reader

    // Filename is just the name of the file without path information.
    Filename *string

    Purpose *string

    FileLinkData *FileFileLinkDataParams
}

FileParams is the set of parameters that can be used when creating a file. For more details see https://stripe.com/docs/api#create_file.

func (*FileParams) GetBody Uses

func (f *FileParams) GetBody() (*bytes.Buffer, string, error)

GetBody gets an appropriate multipart form payload to use in a request body to create a new file.

type FilePurpose Uses

type FilePurpose string

FilePurpose is the purpose of a particular file.

const (
              FilePurpose = "business_logo"
    FilePurposeCustomerSignature     FilePurpose = "customer_signature"
    FilePurposeDisputeEvidence       FilePurpose = "dispute_evidence"
    FilePurposeFinanceReportRun      FilePurpose = "finance_report_run"
    FilePurposeFoundersStockDocument FilePurpose = "founders_stock_document"
    FilePurposeIdentityDocument      FilePurpose = "identity_document"
    FilePurposePCIDocument           FilePurpose = "pci_document"
    FilePurposeSigmaScheduledQuery   FilePurpose = "sigma_scheduled_query"
    FilePurposeTaxDocumentUserUpload FilePurpose = "tax_document_user_upload"
)

List of values that FilePurpose can take.

type Filters Uses

type Filters struct {
    // contains filtered or unexported fields
}

Filters is a structure that contains a collection of filters for list-related APIs.

func (*Filters) AddFilter Uses

func (f *Filters) AddFilter(key, op, value string)

AddFilter adds a new filter with a given key, op and value.

func (Filters) AppendTo Uses

func (f Filters) AppendTo(body *form.Values, keyParts []string)

AppendTo implements custom form encoding for filters.

type FraudDetails Uses

type FraudDetails struct {
    UserReport   ChargeFraudUserReport   `json:"user_report"`
    StripeReport ChargeFraudStripeReport `json:"stripe_report"`
}

FraudDetails is the structure detailing fraud status.

type FraudDetailsParams Uses

type FraudDetailsParams struct {
    UserReport *string `form:"user_report"`
}

FraudDetailsParams provides information on the fraud details for a charge.

type IdentityVerificationStatus Uses

type IdentityVerificationStatus string

IdentityVerificationStatus describes the different statuses for identity verification.

const (
    IdentityVerificationStatusPending    IdentityVerificationStatus = "pending"
    IdentityVerificationStatusUnverified IdentityVerificationStatus = "unverified"
    IdentityVerificationStatusVerified   IdentityVerificationStatus = "verified"
)

List of values that IdentityVerificationStatus can take.

type InvalidRequestError Uses

type InvalidRequestError struct {
    // contains filtered or unexported fields
}

InvalidRequestError is an error that occurs when a request contains invalid parameters.

func (*InvalidRequestError) Error Uses

func (e *InvalidRequestError) Error() string

Error serializes the error object to JSON and returns it as a string.

type Inventory Uses

type Inventory struct {
    Quantity int64             `json:"quantity"`
    Type     SKUInventoryType  `json:"type"`
    Value    SKUInventoryValue `json:"value"`
}

Inventory represents the inventory options of a SKU.

type InventoryParams Uses

type InventoryParams struct {
    Quantity *int64  `form:"quantity"`
    Type     *string `form:"type"`
    Value    *string `form:"value"`
}

InventoryParams is the set of parameters allowed as inventory on a SKU.

type Invoice Uses

type Invoice struct {
    AccountCountry               string                   `json:"account_country"`
    AccountName                  string                   `json:"account_name"`
    AmountDue                    int64                    `json:"amount_due"`
    AmountPaid                   int64                    `json:"amount_paid"`
    AmountRemaining              int64                    `json:"amount_remaining"`
    ApplicationFeeAmount         int64                    `json:"application_fee_amount"`
    AttemptCount                 int64                    `json:"attempt_count"`
    Attempted                    bool                     `json:"attempted"`
    AutoAdvance                  bool                     `json:"auto_advance"`
    BillingReason                InvoiceBillingReason     `json:"billing_reason"`
    Charge                       *Charge                  `json:"charge"`
    CollectionMethod             *InvoiceCollectionMethod `json:"collection_method"`
    Created                      int64                    `json:"created"`
    Currency                     Currency                 `json:"currency"`
    CustomFields                 []*InvoiceCustomField    `json:"custom_fields"`
    Customer                     *Customer                `json:"customer"`
    CustomerAddress              *Address                 `json:"customer_address"`
    CustomerEmail                string                   `json:"customer_email"`
    CustomerName                 *string                  `json:"customer_name"`
    CustomerPhone                *string                  `json:"customer_phone"`
    CustomerShipping             *CustomerShippingDetails `json:"customer_shipping"`
    CustomerTaxExempt            CustomerTaxExempt        `json:"customer_tax_exempt"`
    CustomerTaxIDs               []*InvoiceCustomerTaxID  `json:"customer_tax_ids"`
    DefaultPaymentMethod         *PaymentMethod           `json:"default_payment_method"`
    DefaultSource                *PaymentSource           `json:"default_source"`
    DefaultTaxRates              []*TaxRate               `json:"default_tax_rates"`
    Description                  string                   `json:"description"`
    Discount                     *Discount                `json:"discount"`
    DueDate                      int64                    `json:"due_date"`
    EndingBalance                int64                    `json:"ending_balance"`
    Footer                       string                   `json:"footer"`
    HostedInvoiceURL             string                   `json:"hosted_invoice_url"`
    ID                           string                   `json:"id"`
    InvoicePDF                   string                   `json:"invoice_pdf"`
    Lines                        *InvoiceLineList         `json:"lines"`
    Livemode                     bool                     `json:"livemode"`
    Metadata                     map[string]string        `json:"metadata"`
    NextPaymentAttempt           int64                    `json:"next_payment_attempt"`
    Number                       string                   `json:"number"`
    Paid                         bool                     `json:"paid"`
    PaymentIntent                *PaymentIntent           `json:"payment_intent"`
    PeriodEnd                    int64                    `json:"period_end"`
    PeriodStart                  int64                    `json:"period_start"`
    PostPaymentCreditNotesAmount int64                    `json:"post_payment_credit_notes_amount"`
    PrePaymentCreditNotesAmount  int64                    `json:"pre_payment_credit_notes_amount"`
    ReceiptNumber                string                   `json:"receipt_number"`
    StartingBalance              int64                    `json:"starting_balance"`
    StatementDescriptor          string                   `json:"statement_descriptor"`
    Status                       InvoiceBillingStatus     `json:"status"`
    StatusTransitions            InvoiceStatusTransitions `json:"status_transitions"`
    Subscription                 string                   `json:"subscription"`
    SubscriptionProrationDate    int64                    `json:"subscription_proration_date"`
    Subtotal                     int64                    `json:"subtotal"`
    Tax                          int64                    `json:"tax"`
    ThreasholdReason             *InvoiceThresholdReason  `json:"threshold_reason"`
    Total                        int64                    `json:"total"`
    TotalTaxAmounts              []*InvoiceTaxAmount      `json:"total_tax_amounts"`
    TransferData                 *InvoiceTransferData     `json:"transfer_data"`
    WebhooksDeliveredAt          int64                    `json:"webhooks_delivered_at"`

    // This field is deprecated and we recommend that you use TaxRates instead.
    TaxPercent float64 `json:"tax_percent"`
}

Invoice is the resource representing a Stripe invoice. For more details see https://stripe.com/docs/api#invoice_object.

Code:

stripe.Key = "sk_key"

params := &stripe.InvoiceParams{
    Description: stripe.String("updated description"),
}

inv, err := invoice.Update("sub_example_id", params)

if err != nil {
    log.Fatal(err)
}

log.Printf("%v\n", inv.Description)

func (*Invoice) UnmarshalJSON Uses

func (i *Invoice) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an Invoice. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type InvoiceBillingReason Uses

type InvoiceBillingReason string

InvoiceBillingReason is the reason why a given invoice was created

const (
    InvoiceBillingReasonManual                InvoiceBillingReason = "manual"
    InvoiceBillingReasonSubscription          InvoiceBillingReason = "subscription"
    InvoiceBillingReasonSubscriptionCreate    InvoiceBillingReason = "subscription_create"
    InvoiceBillingReasonSubscriptionCycle     InvoiceBillingReason = "subscription_cycle"
    InvoiceBillingReasonSubscriptionThreshold InvoiceBillingReason = "subscription_threshold"
    InvoiceBillingReasonSubscriptionUpdate    InvoiceBillingReason = "subscription_update"
    InvoiceBillingReasonUpcoming              InvoiceBillingReason = "upcoming"
)

List of values that InvoiceBillingReason can take.

type InvoiceBillingStatus Uses

type InvoiceBillingStatus string

InvoiceBillingStatus is the reason why a given invoice was created TODO: rename to InvoiceStatus

const (
    InvoiceBillingStatusDraft         InvoiceBillingStatus = "draft"
    InvoiceBillingStatusOpen          InvoiceBillingStatus = "open"
    InvoiceBillingStatusPaid          InvoiceBillingStatus = "paid"
    InvoiceBillingStatusUncollectible InvoiceBillingStatus = "uncollectible"
    InvoiceBillingStatusVoid          InvoiceBillingStatus = "void"
)

List of values that InvoiceBillingStatus can take.

type InvoiceCollectionMethod Uses

type InvoiceCollectionMethod string

InvoiceCollectionMethod is the type of collection method for this invoice.

const (
    InvoiceCollectionMethodChargeAutomatically InvoiceCollectionMethod = "charge_automatically"
    InvoiceCollectionMethodSendInvoice         InvoiceCollectionMethod = "send_invoice"
)

List of values that InvoiceCollectionMethod can take.

type InvoiceCustomField Uses

type InvoiceCustomField struct {
    Name  string `json:"name"`
    Value string `json:"value"`
}

InvoiceCustomField is a structure representing a custom field on an invoice.

type InvoiceCustomFieldParams Uses

type InvoiceCustomFieldParams struct {
    Name  *string `form:"name"`
    Value *string `form:"value"`
}

InvoiceCustomFieldParams represents the parameters associated with one custom field on an invoice.

type InvoiceCustomerTaxID Uses

type InvoiceCustomerTaxID struct {
    Type  TaxIDType `json:"type"`
    Value string    `json:"value"`
}

InvoiceCustomerTaxID is a structure representing a customer tax id on an invoice.

type InvoiceFinalizeParams Uses

type InvoiceFinalizeParams struct {
    Params      `form:"*"`
    AutoAdvance *bool `form:"auto_advance"`
}

InvoiceFinalizeParams is the set of parameters that can be used when finalizing invoices.

type InvoiceItem Uses

type InvoiceItem struct {
    Amount            int64             `json:"amount"`
    Currency          Currency          `json:"currency"`
    Customer          *Customer         `json:"customer"`
    Date              int64             `json:"date"`
    Deleted           bool              `json:"deleted"`
    Description       string            `json:"description"`
    Discountable      bool              `json:"discountable"`
    ID                string            `json:"id"`
    Invoice           *Invoice          `json:"invoice"`
    Livemode          bool              `json:"livemode"`
    Metadata          map[string]string `json:"metadata"`
    Period            *Period           `json:"period"`
    Plan              *Plan             `json:"plan"`
    Proration         bool              `json:"proration"`
    Quantity          int64             `json:"quantity"`
    Subscription      *Subscription     `json:"subscription"`
    TaxRates          []*TaxRate        `json:"tax_rates"`
    UnitAmount        int64             `json:"unit_amount"`
    UnitAmountDecimal float64           `json:"unit_amount_decimal,string"`
}

InvoiceItem is the resource represneting a Stripe invoice item. For more details see https://stripe.com/docs/api#invoiceitems.

func (*InvoiceItem) UnmarshalJSON Uses

func (i *InvoiceItem) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an InvoiceItem. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type InvoiceItemList Uses

type InvoiceItemList struct {
    ListMeta
    Data []*InvoiceItem `json:"data"`
}

InvoiceItemList is a list of invoice items as retrieved from a list endpoint.

type InvoiceItemListParams Uses

type InvoiceItemListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Customer     *string           `form:"customer"`
    Invoice      *string           `form:"invoice"`
    Pending      *bool             `form:"pending"`
}

InvoiceItemListParams is the set of parameters that can be used when listing invoice items. For more details see https://stripe.com/docs/api#list_invoiceitems.

type InvoiceItemParams Uses

type InvoiceItemParams struct {
    Params            `form:"*"`
    Amount            *int64                   `form:"amount"`
    Currency          *string                  `form:"currency"`
    Customer          *string                  `form:"customer"`
    Description       *string                  `form:"description"`
    Discountable      *bool                    `form:"discountable"`
    Invoice           *string                  `form:"invoice"`
    Period            *InvoiceItemPeriodParams `form:"period"`
    Quantity          *int64                   `form:"quantity"`
    Subscription      *string                  `form:"subscription"`
    TaxRates          []*string                `form:"tax_rates"`
    UnitAmount        *int64                   `form:"unit_amount"`
    UnitAmountDecimal *float64                 `form:"unit_amount_decimal,high_precision"`
}

InvoiceItemParams is the set of parameters that can be used when creating or updating an invoice item. For more details see https://stripe.com/docs/api#create_invoiceitem and https://stripe.com/docs/api#update_invoiceitem.

type InvoiceItemPeriodParams Uses

type InvoiceItemPeriodParams struct {
    End   *int64 `form:"end"`
    Start *int64 `form:"start"`
}

InvoiceItemPeriodParams represents the period associated with that invoice item.

type InvoiceLine Uses

type InvoiceLine struct {
    Amount           int64               `json:"amount"`
    Currency         Currency            `json:"currency"`
    Description      string              `json:"description"`
    Discountable     bool                `json:"discountable"`
    ID               string              `json:"id"`
    Livemode         bool                `json:"live_mode"`
    Metadata         map[string]string   `json:"metadata"`
    Period           *Period             `json:"period"`
    Plan             *Plan               `json:"plan"`
    Proration        bool                `json:"proration"`
    Quantity         int64               `json:"quantity"`
    Subscription     string              `json:"subscription"`
    SubscriptionItem string              `json:"subscription_item"`
    TaxAmounts       []*InvoiceTaxAmount `json:"tax_amounts"`
    TaxRates         []*TaxRate          `json:"tax_rates"`
    Type             InvoiceLineType     `json:"type"`
    UnifiedProration bool                `json:"unified_proration"`
}

InvoiceLine is the resource representing a Stripe invoice line item. For more details see https://stripe.com/docs/api#invoice_line_item_object.

type InvoiceLineList Uses

type InvoiceLineList struct {
    ListMeta
    Data []*InvoiceLine `json:"data"`
}

InvoiceLineList is a list object for invoice line items.

type InvoiceLineListParams Uses

type InvoiceLineListParams struct {
    ListParams `form:"*"`

    Customer *string `form:"customer"`

    // ID is the invoice ID to list invoice lines for.
    ID  *string `form:"-"` // Goes in the URL

    Subscription *string `form:"subscription"`
}

InvoiceLineListParams is the set of parameters that can be used when listing invoice line items. For more details see https://stripe.com/docs/api#invoice_lines.

type InvoiceLineType Uses

type InvoiceLineType string

InvoiceLineType is the list of allowed values for the invoice line's type.

const (
    InvoiceLineTypeInvoiceItem  InvoiceLineType = "invoiceitem"
    InvoiceLineTypeSubscription InvoiceLineType = "subscription"
)

List of values that InvoiceLineType can take.

type InvoiceList Uses

type InvoiceList struct {
    ListMeta
    Data []*Invoice `json:"data"`
}

InvoiceList is a list of invoices as retrieved from a list endpoint.

type InvoiceListParams Uses

type InvoiceListParams struct {
    ListParams       `form:"*"`
    CollectionMethod *string           `form:"collection_method"`
    Customer         *string           `form:"customer"`
    Created          *int64            `form:"created"`
    CreatedRange     *RangeQueryParams `form:"created"`
    DueDate          *int64            `form:"due_date"`
    DueDateRange     *RangeQueryParams `form:"due_date"`
    Subscription     *string           `form:"subscription"`
}

InvoiceListParams is the set of parameters that can be used when listing invoices. For more details see https://stripe.com/docs/api#list_customer_invoices.

type InvoiceMarkUncollectibleParams Uses

type InvoiceMarkUncollectibleParams struct {
    Params `form:"*"`
}

InvoiceMarkUncollectibleParams is the set of parameters that can be used when marking invoices as uncollectible.

type InvoiceParams Uses

type InvoiceParams struct {
    Params               `form:"*"`
    AutoAdvance          *bool                       `form:"auto_advance"`
    ApplicationFeeAmount *int64                      `form:"application_fee_amount"`
    CollectionMethod     *string                     `form:"collection_method"`
    CustomFields         []*InvoiceCustomFieldParams `form:"custom_fields"`
    Customer             *string                     `form:"customer"`
    DaysUntilDue         *int64                      `form:"days_until_due"`
    DefaultPaymentMethod *string                     `form:"default_payment_method"`
    DefaultSource        *string                     `form:"default_source"`
    DefaultTaxRates      []*string                   `form:"default_tax_rates"`
    Description          *string                     `form:"description"`
    DueDate              *int64                      `form:"due_date"`
    Footer               *string                     `form:"footer"`
    Paid                 *bool                       `form:"paid"`
    StatementDescriptor  *string                     `form:"statement_descriptor"`
    Subscription         *string                     `form:"subscription"`
    TransferData         *InvoiceTransferDataParams  `form:"transfer_data"`

    Coupon                                  *string                             `form:"coupon"`
    InvoiceItems                            []*InvoiceUpcomingInvoiceItemParams `form:"invoice_items"`
    SubscriptionBillingCycleAnchor          *int64                              `form:"subscription_billing_cycle_anchor"`
    SubscriptionBillingCycleAnchorNow       *bool                               `form:"-"` // See custom AppendTo
    SubscriptionBillingCycleAnchorUnchanged *bool                               `form:"-"` // See custom AppendTo
    SubscriptionCancelAt                    *int64                              `form:"subscription_cancel_at"`
    SubscriptionCancelAtPeriodEnd           *bool                               `form:"subscription_cancel_at_period_end"`
    SubscriptionCancelNow                   *bool                               `form:"subscription_cancel_now"`
    SubscriptionDefaultTaxRates             []*string                           `form:"subscription_default_tax_rates"`
    SubscriptionItems                       []*SubscriptionItemsParams          `form:"subscription_items"`
    SubscriptionPlan                        *string                             `form:"subscription_plan"`
    SubscriptionProrate                     *bool                               `form:"subscription_prorate"`
    SubscriptionProrationDate               *int64                              `form:"subscription_proration_date"`
    SubscriptionQuantity                    *int64                              `form:"subscription_quantity"`
    SubscriptionTrialEnd                    *int64                              `form:"subscription_trial_end"`
    SubscriptionTrialFromPlan               *bool                               `form:"subscription_trial_from_plan"`

    // This parameter is deprecated and we recommend that you use DefaultTaxRates instead.
    TaxPercent *float64 `form:"tax_percent"`

    // This parameter is deprecated and we recommend that you use SubscriptionDefaultTaxRates instead.
    SubscriptionTaxPercent *float64 `form:"subscription_tax_percent"`
}

InvoiceParams is the set of parameters that can be used when creating or updating an invoice. For more details see https://stripe.com/docs/api#create_invoice, https://stripe.com/docs/api#update_invoice.

func (*InvoiceParams) AppendTo Uses

func (p *InvoiceParams) AppendTo(body *form.Values, keyParts []string)

AppendTo implements custom encoding logic for InvoiceParams so that the special "now" value for subscription_billing_cycle_anchor can be implemented (they're otherwise timestamps rather than strings).

type InvoicePayParams Uses

type InvoicePayParams struct {
    Params        `form:"*"`
    Forgive       *bool   `form:"forgive"`
    OffSession    *bool   `form:"off_session"`
    PaidOutOfBand *bool   `form:"paid_out_of_band"`
    PaymentMethod *string `form:"payment_method"`
    Source        *string `form:"source"`
}

InvoicePayParams is the set of parameters that can be used when paying invoices. For more details, see: https://stripe.com/docs/api#pay_invoice.

type InvoiceSendParams Uses

type InvoiceSendParams struct {
    Params `form:"*"`
}

InvoiceSendParams is the set of parameters that can be used when sending invoices.

type InvoiceStatusTransitions Uses

type InvoiceStatusTransitions struct {
    FinalizedAt           int64 `json:"finalized_at"`
    MarkedUncollectibleAt int64 `json:"marked_uncollectible_at"`
    PaidAt                int64 `json:"paid_at"`
    VoidedAt              int64 `json:"voided_at"`
}

InvoiceStatusTransitions are the timestamps at which the invoice status was updated.

type InvoiceTaxAmount Uses

type InvoiceTaxAmount struct {
    Amount    int64    `json:"amount"`
    Inclusive bool     `json:"inclusive"`
    TaxRate   *TaxRate `json:"tax_rate"`
}

InvoiceTaxAmount is a structure representing one of the tax amounts on an invoice.

type InvoiceThresholdReason Uses

type InvoiceThresholdReason struct {
    AmountGTE   int64                               `json:"amount_gte"`
    ItemReasons []*InvoiceThresholdReasonItemReason `json:"item_reasons"`
}

InvoiceThresholdReason is a structure representing a reason for a billing threshold.

type InvoiceThresholdReasonItemReason Uses

type InvoiceThresholdReasonItemReason struct {
    LineItemIDs []string `json:"line_item_ids"`
    UsageGTE    int64    `json:"usage_gte"`
}

InvoiceThresholdReasonItemReason is a structure representing the line items that triggered an invoice.

type InvoiceTransferData Uses

type InvoiceTransferData struct {
    Destination *Account `json:"destination"`
}

InvoiceTransferData represents the information for the transfer_data associated with an invoice.

type InvoiceTransferDataParams Uses

type InvoiceTransferDataParams struct {
    Destination *string `form:"destination"`
}

InvoiceTransferDataParams is the set of parameters allowed for the transfer_data hash.

type InvoiceUpcomingInvoiceItemParams Uses

type InvoiceUpcomingInvoiceItemParams struct {
    Amount            *int64                                  `form:"amount"`
    Currency          *string                                 `form:"currency"`
    Description       *string                                 `form:"description"`
    Discountable      *bool                                   `form:"discountable"`
    InvoiceItem       *string                                 `form:"invoiceitem"`
    Period            *InvoiceUpcomingInvoiceItemPeriodParams `form:"period"`
    Quantity          *int64                                  `form:"quantity"`
    Schedule          *string                                 `form:"schedule"`
    TaxRates          []*string                               `form:"tax_rates"`
    UnitAmount        *int64                                  `form:"unit_amount"`
    UnitAmountDecimal *float64                                `form:"unit_amount_decimal,high_precision"`
}

InvoiceUpcomingInvoiceItemParams is the set of parameters that can be used when adding or modifying invoice items on an upcoming invoice. For more details see https://stripe.com/docs/api#upcoming_invoice-invoice_items.

type InvoiceUpcomingInvoiceItemPeriodParams Uses

type InvoiceUpcomingInvoiceItemPeriodParams struct {
    End   *int64 `form:"end"`
    Start *int64 `form:"start"`
}

InvoiceUpcomingInvoiceItemPeriodParams represents the period associated with that invoice item

type InvoiceVoidParams Uses

type InvoiceVoidParams struct {
    Params `form:"*"`
}

InvoiceVoidParams is the set of parameters that can be used when voiding invoices.

type IssuingAuthorization Uses

type IssuingAuthorization struct {
    Approved                 bool                                    `json:"approved"`
    AuthorizationMethod      IssuingAuthorizationAuthorizationMethod `json:"authorization_method"`
    AuthorizedAmount         int64                                   `json:"authorized_amount"`
    AuthorizedCurrency       Currency                                `json:"authorized_currency"`
    BalanceTransactions      []*BalanceTransaction                   `json:"balance_transactions"`
    Card                     *IssuingCard                            `json:"card"`
    Cardholder               *IssuingCardholder                      `json:"cardholder"`
    Created                  int64                                   `json:"created"`
    HeldAmount               int64                                   `json:"held_amount"`
    HeldCurrency             Currency                                `json:"held_currency"`
    ID                       string                                  `json:"id"`
    IsHeldAmountControllable bool                                    `json:"is_held_amount_controllable"`
    Livemode                 bool                                    `json:"livemode"`
    MerchantData             *IssuingMerchantData                    `json:"merchant_data"`
    Metadata                 map[string]string                       `json:"metadata"`
    Object                   string                                  `json:"object"`
    PendingAuthorizedAmount  int64                                   `json:"pending_authorized_amount"`
    PendingHeldAmount        int64                                   `json:"pending_held_amount"`
    RequestHistory           []*IssuingAuthorizationRequestHistory   `json:"request_history"`
    Status                   IssuingAuthorizationStatus              `json:"status"`
    Transactions             []*IssuingTransaction                   `json:"transactions"`
    VerificationData         *IssuingAuthorizationVerificationData   `json:"verification_data"`
    WalletProvider           IssuingAuthorizationWalletProviderType  `json:"wallet_provider"`
}

IssuingAuthorization is the resource representing a Stripe issuing authorization.

func (*IssuingAuthorization) UnmarshalJSON Uses

func (i *IssuingAuthorization) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an IssuingAuthorization. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type IssuingAuthorizationAuthorizationControls Uses

type IssuingAuthorizationAuthorizationControls struct {
    AllowedCategories []string `json:"allowed_categories"`
    BlockedCategories []string `json:"blocked_categories"`
    Currency          Currency `json:"currency"`
    MaxAmount         int64    `json:"max_amount"`
    MaxApprovals      int64    `json:"max_approvals"`
}

IssuingAuthorizationAuthorizationControls is the resource representing authorization controls on an issuing authorization.

type IssuingAuthorizationAuthorizationMethod Uses

type IssuingAuthorizationAuthorizationMethod string

IssuingAuthorizationAuthorizationMethod is the list of possible values for the authorization method on an issuing authorization.

const (
    IssuingAuthorizationAuthorizationMethodChip        IssuingAuthorizationAuthorizationMethod = "chip"
    IssuingAuthorizationAuthorizationMethodContactless IssuingAuthorizationAuthorizationMethod = "contactless"
    IssuingAuthorizationAuthorizationMethodKeyedIn     IssuingAuthorizationAuthorizationMethod = "keyed_in"
    IssuingAuthorizationAuthorizationMethodOnline      IssuingAuthorizationAuthorizationMethod = "online"
    IssuingAuthorizationAuthorizationMethodSwipe       IssuingAuthorizationAuthorizationMethod = "swipe"
)

List of values that IssuingAuthorizationAuthorizationMethod can take.

type IssuingAuthorizationControlsSpendingLimits Uses

type IssuingAuthorizationControlsSpendingLimits struct {
    Amount     int64                        `json:"amount"`
    Categories []string                     `json:"categories"`
    Interval   IssuingSpendingLimitInterval `json:"interval"`
}

IssuingAuthorizationControlsSpendingLimits is the resource representing spending limits associated with a card or cardholder.

type IssuingAuthorizationControlsSpendingLimitsParams Uses

type IssuingAuthorizationControlsSpendingLimitsParams struct {
    Amount     *int64    `form:"amount"`
    Categories []*string `form:"categories"`
    Interval   *string   `form:"interval"`
}

IssuingAuthorizationControlsSpendingLimitsParams is the set of parameters that can be used for the spending limits associated with a given issuing card or cardholder.

type IssuingAuthorizationList Uses

type IssuingAuthorizationList struct {
    ListMeta
    Data []*IssuingAuthorization `json:"data"`
}

IssuingAuthorizationList is a list of issuing authorizations as retrieved from a list endpoint.

type IssuingAuthorizationListParams Uses

type IssuingAuthorizationListParams struct {
    ListParams   `form:"*"`
    Card         *string           `form:"card"`
    Cardholder   *string           `form:"cardholder"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Status       *string           `form:"status"`
}

IssuingAuthorizationListParams is the set of parameters that can be used when listing issuing authorizations.

type IssuingAuthorizationParams Uses

type IssuingAuthorizationParams struct {
    Params     `form:"*"`
    HeldAmount *int64 `form:"held_amount"`
}

IssuingAuthorizationParams is the set of parameters that can be used when updating an issuing authorization.

type IssuingAuthorizationRequestHistory Uses

type IssuingAuthorizationRequestHistory struct {
    Approved           bool                                     `json:"approved"`
    AuthorizedAmount   int64                                    `json:"authorized_amount"`
    AuthorizedCurrency Currency                                 `json:"authorized_currency"`
    Created            int64                                    `json:"created"`
    HeldAmount         int64                                    `json:"held_amount"`
    HeldCurrency       Currency                                 `json:"held_currency"`
    Reason             IssuingAuthorizationRequestHistoryReason `json:"reason"`
}

IssuingAuthorizationRequestHistory is the resource representing a request history on an issuing authorization.

type IssuingAuthorizationRequestHistoryReason Uses

type IssuingAuthorizationRequestHistoryReason string

IssuingAuthorizationRequestHistoryReason is the list of possible values for the request history reason on an issuing authorization.

const (
    IssuingAuthorizationRequestHistoryReasonAuthorizationControls IssuingAuthorizationRequestHistoryReason = "authorization_controls"
    IssuingAuthorizationRequestHistoryReasonCardActive            IssuingAuthorizationRequestHistoryReason = "card_active"
    IssuingAuthorizationRequestHistoryReasonCardInactive          IssuingAuthorizationRequestHistoryReason = "card_inactive"
    IssuingAuthorizationRequestHistoryReasonInsufficientFunds     IssuingAuthorizationRequestHistoryReason = "insufficient_funds"
    IssuingAuthorizationRequestHistoryReasonWebhookApproved       IssuingAuthorizationRequestHistoryReason = "webhook_approved"
    IssuingAuthorizationRequestHistoryReasonWebhookDeclined       IssuingAuthorizationRequestHistoryReason = "webhook_declined"
    IssuingAuthorizationRequestHistoryReasonWebhookTimeout        IssuingAuthorizationRequestHistoryReason = "webhook_timeout"
)

List of values that IssuingAuthorizationRequestHistoryReason can take.

type IssuingAuthorizationStatus Uses

type IssuingAuthorizationStatus string

IssuingAuthorizationStatus is the possible values for status for an issuing authorization.

const (
    IssuingAuthorizationStatusClosed   IssuingAuthorizationStatus = "closed"
    IssuingAuthorizationStatusPending  IssuingAuthorizationStatus = "pending"
    IssuingAuthorizationStatusReversed IssuingAuthorizationStatus = "reversed"
)

List of values that IssuingAuthorizationStatus can take.

type IssuingAuthorizationVerificationData Uses

type IssuingAuthorizationVerificationData struct {
    AddressLine1Check IssuingAuthorizationVerificationDataCheck          `json:"address_line1_check"`
    AddressZipCheck   IssuingAuthorizationVerificationDataCheck          `json:"address_zip_check"`
    Authentication    IssuingAuthorizationVerificationDataAuthentication `json:"authentication"`
    CVCCheck          IssuingAuthorizationVerificationDataCheck          `json:"cvc_check"`
}

IssuingAuthorizationVerificationData is the resource representing verification data on an issuing authorization.

type IssuingAuthorizationVerificationDataAuthentication Uses

type IssuingAuthorizationVerificationDataAuthentication string

IssuingAuthorizationVerificationDataAuthentication is the list of possible values for the result of an authentication on an issuing authorization.

const (
    IssuingAuthorizationVerificationDataAuthenticationExempt  IssuingAuthorizationVerificationDataAuthentication = "exempt"
    IssuingAuthorizationVerificationDataAuthenticationFailure IssuingAuthorizationVerificationDataAuthentication = "failure"
    IssuingAuthorizationVerificationDataAuthenticationNone    IssuingAuthorizationVerificationDataAuthentication = "none"
    IssuingAuthorizationVerificationDataAuthenticationSuccess IssuingAuthorizationVerificationDataAuthentication = "success"
)

List of values that IssuingAuthorizationVerificationDataCheck can take.

type IssuingAuthorizationVerificationDataCheck Uses

type IssuingAuthorizationVerificationDataCheck string

IssuingAuthorizationVerificationDataCheck is the list of possible values for result of a check for verification data on an issuing authorization.

const (
    IssuingAuthorizationVerificationDataCheckMatch       IssuingAuthorizationVerificationDataCheck = "match"
    IssuingAuthorizationVerificationDataCheckMismatch    IssuingAuthorizationVerificationDataCheck = "mismatch"
    IssuingAuthorizationVerificationDataCheckNotProvided IssuingAuthorizationVerificationDataCheck = "not_provided"
)

List of values that IssuingAuthorizationVerificationDataCheck can take.

type IssuingAuthorizationWalletProviderType Uses

type IssuingAuthorizationWalletProviderType string

IssuingAuthorizationWalletProviderType is the list of possible values for the authorization's wallet provider.

const (
    IssuingAuthorizationWalletProviderTypeApplePay   IssuingAuthorizationWalletProviderType = "apple_pay"
    IssuingAuthorizationWalletProviderTypeGooglePay  IssuingAuthorizationWalletProviderType = "google_pay"
    IssuingAuthorizationWalletProviderTypeSamsungPay IssuingAuthorizationWalletProviderType = "samsung_pay"
)

List of values that IssuingAuthorizationWalletProviderType can take.

type IssuingBilling Uses

type IssuingBilling struct {
    Address *Address `json:"address"`
    Name    string   `json:"name"`
}

IssuingBilling is the resource representing the billing hash with the Issuing APIs.

type IssuingBillingParams Uses

type IssuingBillingParams struct {
    Address *AddressParams `form:"address"`
    Name    *string        `form:"name"`
}

IssuingBillingParams is the set of parameters that can be used for billing with the Issuing APIs.

type IssuingCard Uses

type IssuingCard struct {
    AuthorizationControls *IssuingCardAuthorizationControls `json:"authorization_controls"`
    Billing               *IssuingBilling                   `json:"billing"`
    Brand                 string                            `json:"brand"`
    Cardholder            *IssuingCardholder                `json:"cardholder"`
    Created               int64                             `json:"created"`
    ExpMonth              int64                             `json:"exp_month"`
    ExpYear               int64                             `json:"exp_year"`
    Last4                 string                            `json:"last4"`
    ID                    string                            `json:"id"`
    Livemode              bool                              `json:"livemode"`
    Metadata              map[string]string                 `json:"metadata"`
    Name                  string                            `json:"name"`
    Object                string                            `json:"object"`
    PIN                   *IssuingCardPIN                   `json:"pin"`
    ReplacementFor        *IssuingCard                      `json:"replacement_for"`
    ReplacementReason     IssuingCardReplacementReason      `json:"replacement_reason"`
    Shipping              *IssuingCardShipping              `json:"shipping"`
    Status                IssuingCardStatus                 `json:"status"`
    Type                  IssuingCardType                   `json:"type"`
}

IssuingCard is the resource representing a Stripe issuing card.

func (*IssuingCard) UnmarshalJSON Uses

func (i *IssuingCard) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an IssuingCard. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type IssuingCardAuthorizationControls Uses

type IssuingCardAuthorizationControls struct {
    AllowedCategories []string                                      `json:"allowed_categories"`
    BlockedCategories []string                                      `json:"blocked_categories"`
    SpendingLimits    []*IssuingAuthorizationControlsSpendingLimits `json:"spending_limits"`

    // The properties below are considered deprecated and can only be used for an issuing card.
    Currency     Currency `json:"currency"`
    MaxAmount    int64    `json:"max_amount"`
    MaxApprovals int64    `json:"max_approvals"`
}

IssuingCardAuthorizationControls is the resource representing authorization controls on an issuing card. TODO: Rename to IssuingAuthorizationControls in the next major

type IssuingCardDetails Uses

type IssuingCardDetails struct {
    Card     *IssuingCard `json:"card"`
    CVC      string       `json:"cvc"`
    ExpMonth *string      `form:"exp_month"`
    ExpYear  *string      `form:"exp_year"`
    Number   string       `json:"number"`
    Object   string       `json:"object"`
}

IssuingCardDetails is the resource representing issuing card details.

type IssuingCardList Uses

type IssuingCardList struct {
    ListMeta
    Data []*IssuingCard `json:"data"`
}

IssuingCardList is a list of issuing cards as retrieved from a list endpoint.

type IssuingCardListParams Uses

type IssuingCardListParams struct {
    ListParams   `form:"*"`
    Cardholder   *string           `form:"cardholder"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    ExpMonth     *int64            `form:"exp_month"`
    ExpYear      *int64            `form:"exp_year"`
    Name         *string           `form:"name"`
    Last4        *string           `form:"last4"`
    Source       *string           `form:"source"`
    Status       *string           `form:"status"`
    Type         *string           `form:"type"`
}

IssuingCardListParams is the set of parameters that can be used when listing issuing cards.

type IssuingCardPIN Uses

type IssuingCardPIN struct {
    Status IssuingCardPINStatus `json:"status"`
}

IssuingCardPIN contains data about the Card's PIN.

type IssuingCardPINStatus Uses

type IssuingCardPINStatus string

IssuingCardPINStatus is the list of possible values for the status field of a Card PIN.

const (
    IssuingCardPINStatusActive  IssuingCardPINStatus = "active"
    IssuingCardPINStatusBlocked IssuingCardPINStatus = "blocked"
)

List of values that IssuingCardPINStatus can take.

type IssuingCardParams Uses

type IssuingCardParams struct {
    Params                `form:"*"`
    AuthorizationControls *AuthorizationControlsParams `form:"authorization_controls"`
    Billing               *IssuingBillingParams        `form:"billing"`
    Cardholder            *string                      `form:"cardholder"`
    Currency              *string                      `form:"currency"`
    Name                  *string                      `form:"name"`
    ReplacementFor        *string                      `form:"replacement_for"`
    ReplacementReason     *string                      `form:"replacement_reason"`
    Status                *string                      `form:"status"`
    Shipping              *IssuingCardShippingParams   `form:"shipping"`
    Type                  *string                      `form:"type"`
}

IssuingCardParams is the set of parameters that can be used when creating or updating an issuing card.

type IssuingCardReplacementReason Uses

type IssuingCardReplacementReason string

IssuingCardReplacementReason is the list of possible values for the replacement reason on an issuing card.

const (
    IssuingCardReplacementReasonDamage     IssuingCardReplacementReason = "damage"
    IssuingCardReplacementReasonExpiration IssuingCardReplacementReason = "expiration"
    IssuingCardReplacementReasonLoss       IssuingCardReplacementReason = "loss"
    IssuingCardReplacementReasonTheft      IssuingCardReplacementReason = "theft"
)

List of values that IssuingCardReplacementReason can take.

type IssuingCardShipping Uses

type IssuingCardShipping struct {
    Address        *Address                  `json:"address"`
    Carrier        string                    `json:"carrier"`
    ETA            int64                     `json:"eta"`
    Name           string                    `json:"name"`
    Phone          string                    `json:"phone"`
    Status         IssuingCardShippingStatus `json:"status"`
    TrackingNumber string                    `json:"tracking_number"`
    Type           IssuingCardShippingType   `json:"type"`
}

IssuingCardShipping is the resource representing shipping on an issuing card.

type IssuingCardShippingParams Uses

type IssuingCardShippingParams struct {
    Address *AddressParams `form:"address"`
    Name    string         `form:"name"`
    Type    *string        `form:"type"`
}

IssuingCardShippingParams is the set of parameters that can be used for the shipping parameter.

type IssuingCardShippingStatus Uses

type IssuingCardShippingStatus string

IssuingCardShippingStatus is the list of possible values for the shipping status on an issuing card.

const (
    IssuingCardShippingTypeDelivered IssuingCardShippingStatus = "delivered"
    IssuingCardShippingTypeFailure   IssuingCardShippingStatus = "failure"
    IssuingCardShippingTypePending   IssuingCardShippingStatus = "pending"
    IssuingCardShippingTypeReturned  IssuingCardShippingStatus = "returned"
    IssuingCardShippingTypeShipped   IssuingCardShippingStatus = "shipped"
)

List of values that IssuingCardShippingStatus can take.

type IssuingCardShippingType Uses

type IssuingCardShippingType string

IssuingCardShippingType is the list of possible values for the shipping type on an issuing card.

const (
    IssuingCardShippingTypeBulk       IssuingCardShippingType = "bulk"
    IssuingCardShippingTypeIndividual IssuingCardShippingType = "individual"
)

List of values that IssuingCardShippingType can take.

type IssuingCardStatus Uses

type IssuingCardStatus string

IssuingCardStatus is the list of possible values for status on an issuing card.

const (
    IssuingCardStatusActive   IssuingCardStatus = "active"
    IssuingCardStatusCanceled IssuingCardStatus = "canceled"
    IssuingCardStatusInactive IssuingCardStatus = "inactive"
    IssuingCardStatusPending  IssuingCardStatus = "pending"
)

List of values that IssuingCardStatus can take.

type IssuingCardType Uses

type IssuingCardType string

IssuingCardType is the type of an issuing card.

const (
    IssuingCardTypePhysical IssuingCardType = "physical"
    IssuingCardTypeVirtual  IssuingCardType = "virtual"
)

List of values that IssuingCardType can take.

type IssuingCardholder Uses

type IssuingCardholder struct {
    AuthorizationControls *IssuingCardAuthorizationControls `json:"authorization_controls"`
    Billing               *IssuingBilling                   `json:"billing"`
    Company               *IssuingCardholderCompany         `json:"company"`
    Created               int64                             `json:"created"`
    Email                 string                            `json:"email"`
    ID                    string                            `json:"id"`
    Individual            *IssuingCardholderIndividual      `json:"individual"`
    Livemode              bool                              `json:"livemode"`
    Metadata              map[string]string                 `json:"metadata"`
    Name                  string                            `json:"name"`
    Object                string                            `json:"object"`
    PhoneNumber           string                            `json:"phone_number"`
    Requirements          *IssuingCardholderRequirements    `json:"requirements"`
    Status                IssuingCardholderStatus           `json:"status"`
    Type                  IssuingCardholderType             `json:"type"`
}

IssuingCardholder is the resource representing a Stripe issuing cardholder.

func (*IssuingCardholder) UnmarshalJSON Uses

func (i *IssuingCardholder) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an IssuingCardholder. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type IssuingCardholderCompany Uses

type IssuingCardholderCompany struct {
    TaxIDProvided bool `json:"tax_id_provided"`
}

IssuingCardholderCompany represents additional information about a business_entity cardholder.

type IssuingCardholderCompanyParams Uses

type IssuingCardholderCompanyParams struct {
    TaxID *string `form:"tax_id"`
}

IssuingCardholderCompanyParams represents additional information about a `business_entity` cardholder.

type IssuingCardholderIndividual Uses

type IssuingCardholderIndividual struct {
    DOB          *IssuingCardholderIndividualDOB          `json:"dob"`
    FirstName    string                                   `json:"first_name"`
    LastName     string                                   `json:"last_name"`
    Verification *IssuingCardholderIndividualVerification `json:"verification"`
}

IssuingCardholderIndividual represents additional information about an individual cardholder.

type IssuingCardholderIndividualDOB Uses

type IssuingCardholderIndividualDOB struct {
    Day   int64 `json:"day"`
    Month int64 `json:"month"`
    Year  int64 `json:"year"`
}

IssuingCardholderIndividualDOB represents the date of birth of the issuing card hoder individual.

type IssuingCardholderIndividualDOBParams Uses

type IssuingCardholderIndividualDOBParams struct {
    Day   *int64 `form:"day"`
    Month *int64 `form:"month"`
    Year  *int64 `form:"year"`
}

IssuingCardholderIndividualDOBParams represents the date of birth of the cardholder individual.

type IssuingCardholderIndividualParams Uses

type IssuingCardholderIndividualParams struct {
    DOB          *IssuingCardholderIndividualDOBParams          `form:"dob"`
    FirstName    *string                                        `form:"first_name"`
    LastName     *string                                        `form:"last_name"`
    Verification *IssuingCardholderIndividualVerificationParams `form:"verification"`
}

IssuingCardholderIndividualParams represents additional information about an `individual` cardholder.

type IssuingCardholderIndividualVerification Uses

type IssuingCardholderIndividualVerification struct {
    Document *IssuingCardholderIndividualVerificationDocument `json:"document"`
}

IssuingCardholderIndividualVerification represents the Government-issued ID document for this cardholder

type IssuingCardholderIndividualVerificationDocument Uses

type IssuingCardholderIndividualVerificationDocument struct {
    Back  *File `json:"back"`
    Front *File `json:"front"`
}

IssuingCardholderIndividualVerificationDocument represents an identifying document, either a passport or local ID card.

type IssuingCardholderIndividualVerificationDocumentParams Uses

type IssuingCardholderIndividualVerificationDocumentParams struct {
    Back  *string `form:"back"`
    Front *string `form:"front"`
}

IssuingCardholderIndividualVerificationDocumentParams represents an identifying document, either a passport or local ID card.

type IssuingCardholderIndividualVerificationParams Uses

type IssuingCardholderIndividualVerificationParams struct {
    Document *IssuingCardholderIndividualVerificationDocumentParams `form:"document"`
}

IssuingCardholderIndividualVerificationParams represents government-issued ID document for this cardholder.

type IssuingCardholderList Uses

type IssuingCardholderList struct {
    ListMeta
    Data []*IssuingCardholder `json:"data"`
}

IssuingCardholderList is a list of issuing cardholders as retrieved from a list endpoint.

type IssuingCardholderListParams Uses

type IssuingCardholderListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Email        *string           `form:"email"`
    IsDefault    *bool             `form:"is_default"`
    PhoneNumber  *string           `form:"phone_number"`
    Status       *string           `form:"status"`
    Type         *string           `form:"type"`
}

IssuingCardholderListParams is the set of parameters that can be used when listing issuing cardholders.

type IssuingCardholderParams Uses

type IssuingCardholderParams struct {
    Params                `form:"*"`
    AuthorizationControls *AuthorizationControlsParams       `form:"authorization_controls"`
    Billing               *IssuingBillingParams              `form:"billing"`
    Company               *IssuingCardholderCompanyParams    `form:"company"`
    Email                 *string                            `form:"email"`
    Individual            *IssuingCardholderIndividualParams `form:"individual"`
    IsDefault             *bool                              `form:"is_default"`
    Name                  *string                            `form:"name"`
    PhoneNumber           *string                            `form:"phone_number"`
    Status                *string                            `form:"status"`
    Type                  *string                            `form:"type"`
}

IssuingCardholderParams is the set of parameters that can be used when creating or updating an issuing cardholder.

type IssuingCardholderRequirements Uses

type IssuingCardholderRequirements struct {
    DisabledReason IssuingCardholderRequirementsDisabledReason `json:"disabled_reason"`
    PastDue        []string                                    `json:"past_due"`
}

IssuingCardholderRequirements contains the verification requirements for the cardholder.

type IssuingCardholderRequirementsDisabledReason Uses

type IssuingCardholderRequirementsDisabledReason string

IssuingCardholderRequirementsDisabledReason is the possible values for the disabled reason on an issuing cardholder.

const (
    IssuingCardholderRequirementsDisabledReasonListed         IssuingCardholderRequirementsDisabledReason = "listed"
    IssuingCardholderRequirementsDisabledReasonRejectedListed IssuingCardholderRequirementsDisabledReason = "rejected.listed"
    IssuingCardholderRequirementsDisabledReasonUnderReview    IssuingCardholderRequirementsDisabledReason = "under_review"
)

List of values that IssuingCardholderRequirementsDisabledReason can take.

type IssuingCardholderStatus Uses

type IssuingCardholderStatus string

IssuingCardholderStatus is the possible values for status on an issuing cardholder.

const (
    IssuingCardholderStatusActive   IssuingCardholderStatus = "active"
    IssuingCardholderStatusInactive IssuingCardholderStatus = "inactive"
    IssuingCardholderStatusPending  IssuingCardholderStatus = "pending"
)

List of values that IssuingCardholderStatus can take.

type IssuingCardholderType Uses

type IssuingCardholderType string

IssuingCardholderType is the type of an issuing cardholder.

const (
    IssuingCardholderTypeBusinessEntity IssuingCardholderType = "business_entity"
    IssuingCardholderTypeIndividual     IssuingCardholderType = "individual"
)

List of values that IssuingCardholderType can take.

type IssuingDispute Uses

type IssuingDispute struct {
    Amount      int64                   `json:"amount"`
    Created     int64                   `json:"created"`
    Currency    Currency                `json:"currency"`
    Evidence    *IssuingDisputeEvidence `json:"evidence"`
    ID          string                  `json:"id"`
    Livemode    bool                    `json:"livemode"`
    Metadata    map[string]string       `json:"metadata"`
    Object      string                  `json:"object"`
    Reason      IssuingDisputeReason    `json:"reason"`
    Status      IssuingDisputeStatus    `json:"status"`
    Transaction *IssuingTransaction     `json:"transaction"`
}

IssuingDispute is the resource representing an issuing dispute.

func (*IssuingDispute) UnmarshalJSON Uses

func (i *IssuingDispute) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an IssuingDispute. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type IssuingDisputeEvidence Uses

type IssuingDisputeEvidence struct {
    Fraudulent *IssuingDisputeEvidenceFraudulent `json:"fraudulent"`
    Other      *IssuingDisputeEvidenceOther      `json:"other"`
}

IssuingDisputeEvidence is the resource representing evidence on an issuing dispute.

type IssuingDisputeEvidenceFraudulent Uses

type IssuingDisputeEvidenceFraudulent struct {
    DisputeExplanation string `json:"dispute_explanation"`
    UncategorizedFile  *File  `json:"uncategorized_file"`
}

IssuingDisputeEvidenceFraudulent is the resource representing the evidence hash on an issuing dispute with the reason set as fraudulent.

type IssuingDisputeEvidenceFraudulentParams Uses

type IssuingDisputeEvidenceFraudulentParams struct {
    DisputeExplanation *string `form:"dispute_explanation"`
    UncategorizedFile  *string `form:"uncategorized_file"`
}

IssuingDisputeEvidenceFraudulentParams is the subset of parameters that can be sent as evidence for an issuing dispute with the reason set as fraudulent.

type IssuingDisputeEvidenceOther Uses

type IssuingDisputeEvidenceOther struct {
    DisputeExplanation string `json:"dispute_explanation"`
    UncategorizedFile  *File  `json:"uncategorized_file"`
}

IssuingDisputeEvidenceOther is the resource representing the evidence hash on an issuing dispute with the reason set as other.

type IssuingDisputeEvidenceOtherParams Uses

type IssuingDisputeEvidenceOtherParams struct {
    DisputeExplanation *string `form:"dispute_explanation"`
    UncategorizedFile  *string `form:"uncategorized_file"`
}

IssuingDisputeEvidenceOtherParams is the subset of parameters that can be sent as evidence for an issuing dispute with the reason set as other.

type IssuingDisputeEvidenceParams Uses

type IssuingDisputeEvidenceParams struct {
    Fraudulent *IssuingDisputeEvidenceFraudulentParams `form:"fraudulent"`
    Other      *IssuingDisputeEvidenceOtherParams      `form:"other"`
}

IssuingDisputeEvidenceParams is the set of parameters that can be sent as evidence for an issuing dispute.

type IssuingDisputeList Uses

type IssuingDisputeList struct {
    ListMeta
    Data []*IssuingDispute `json:"data"`
}

IssuingDisputeList is a list of issuing disputes as retrieved from a list endpoint.

type IssuingDisputeListParams Uses

type IssuingDisputeListParams struct {
    ListParams          `form:"*"`
    Created             *int64            `form:"created"`
    CreatedRange        *RangeQueryParams `form:"created"`
    DisputedTransaction *string           `form:"disputed_transaction"`
    Transaction         *string           `form:"transaction"`
}

IssuingDisputeListParams is the set of parameters that can be used when listing issuing dispute.

type IssuingDisputeParams Uses

type IssuingDisputeParams struct {
    Params              `form:"*"`
    Amount              *int64                        `form:"amount"`
    Evidence            *IssuingDisputeEvidenceParams `form:"evidence"`
    Reason              *string                       `form:"reason"`
    DisputedTransaction *string                       `form:"disputed_transaction"`
}

IssuingDisputeParams is the set of parameters that can be used when creating or updating an issuing dispute.

type IssuingDisputeReason Uses

type IssuingDisputeReason string

IssuingDisputeReason is the list of possible values for status on an issuing dispute.

const (
    IssuingDisputeReasonFraudulent IssuingDisputeReason = "fraudulent"
    IssuingDisputeReasonOther      IssuingDisputeReason = "other"
)

List of values that IssuingDisputeReason can take.

type IssuingDisputeStatus Uses

type IssuingDisputeStatus string

IssuingDisputeStatus is the list of possible values for status on an issuing dispute.

const (
    IssuingDisputeStatusLost        IssuingDisputeStatus = "lost"
    IssuingDisputeStatusUnderReview IssuingDisputeStatus = "under_review"
    IssuingDisputeStatusUnsubmitted IssuingDisputeStatus = "unsubmitted"
    IssuingDisputeStatusWon         IssuingDisputeStatus = "won"
)

List of values that IssuingDisputeStatus can take.

type IssuingMerchantData Uses

type IssuingMerchantData struct {
    Category   string `json:"category"`
    City       string `json:"city"`
    Country    string `json:"country"`
    Name       string `json:"name"`
    NetworkID  string `json:"network_id"`
    PostalCode string `json:"postal_code"`
    State      string `json:"state"`
    URL        string `json:"url"`
}

IssuingMerchantData is the resource representing merchant data on Issuing APIs.

type IssuingSpendingLimitInterval Uses

type IssuingSpendingLimitInterval string

IssuingSpendingLimitInterval is the list of possible values for the interval of a given spending limit on an issuing card or cardholder.

const (
    IssuingSpendingLimitIntervalAllTime          IssuingSpendingLimitInterval = "all_time"
    IssuingSpendingLimitIntervalDaily            IssuingSpendingLimitInterval = "daily"
    IssuingSpendingLimitIntervalMonthly          IssuingSpendingLimitInterval = "monthly"
    IssuingSpendingLimitIntervalPerAuthorization IssuingSpendingLimitInterval = "per_authorization"
    IssuingSpendingLimitIntervalWeekly           IssuingSpendingLimitInterval = "weekly"
    IssuingSpendingLimitIntervalYearly           IssuingSpendingLimitInterval = "yearly"
)

List of values that IssuingCardShippingStatus can take.

type IssuingTransaction Uses

type IssuingTransaction struct {
    Amount             int64                  `json:"amount"`
    Authorization      *IssuingAuthorization  `json:"authorization"`
    BalanceTransaction *BalanceTransaction    `json:"balance_transaction"`
    Card               *IssuingCard           `json:"card"`
    Cardholder         *IssuingCardholder     `json:"cardholder"`
    Created            int64                  `json:"created"`
    Currency           Currency               `json:"currency"`
    Dispute            *IssuingDispute        `json:"dispute"`
    ID                 string                 `json:"id"`
    Livemode           bool                   `json:"livemode"`
    MerchantData       *IssuingMerchantData   `json:"merchant_data"`
    MerchantAmount     int64                  `json:"merchant_amount"`
    MerchantCurrency   Currency               `json:"merchant_currency"`
    Metadata           map[string]string      `json:"metadata"`
    Object             string                 `json:"object"`
    Type               IssuingTransactionType `json:"type"`
}

IssuingTransaction is the resource representing a Stripe issuing transaction.

func (*IssuingTransaction) UnmarshalJSON Uses

func (i *IssuingTransaction) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an IssuingTransaction. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type IssuingTransactionList Uses

type IssuingTransactionList struct {
    ListMeta
    Data []*IssuingTransaction `json:"data"`
}

IssuingTransactionList is a list of issuing transactions as retrieved from a list endpoint.

type IssuingTransactionListParams Uses

type IssuingTransactionListParams struct {
    ListParams   `form:"*"`
    Card         *string           `form:"card"`
    Cardholder   *string           `form:"cardholder"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Dispute      *string           `form:"dispute"`
}

IssuingTransactionListParams is the set of parameters that can be used when listing issuing transactions.

type IssuingTransactionParams Uses

type IssuingTransactionParams struct {
    Params `form:"*"`
}

IssuingTransactionParams is the set of parameters that can be used when creating or updating an issuing transaction.

type IssuingTransactionType Uses

type IssuingTransactionType string

IssuingTransactionType is the type of an issuing transaction.

const (
    IssuingTransactionTypeCapture        IssuingTransactionType = "capture"
    IssuingTransactionTypeCashWithdrawal IssuingTransactionType = "cash_withdrawal"
    IssuingTransactionTypeRefund         IssuingTransactionType = "refund"
    IssuingTransactionTypeRefundReversal IssuingTransactionType = "refund_reversal"
)

List of values that IssuingTransactionType can take.

type Iter Uses

type Iter struct {
    // contains filtered or unexported fields
}

Iter provides a convenient interface for iterating over the elements returned from paginated list API calls. Successive calls to the Next method will step through each item in the list, fetching pages of items as needed. Iterators are not thread-safe, so they should not be consumed across multiple goroutines.

func GetIter Uses

func GetIter(container ListParamsContainer, query Query) *Iter

GetIter returns a new Iter for a given query and its options.

func (*Iter) Current Uses

func (it *Iter) Current() interface{}

Current returns the most recent item visited by a call to Next.

func (*Iter) Err Uses

func (it *Iter) Err() error

Err returns the error, if any, that caused the Iter to stop. It must be inspected after Next returns false.

func (*Iter) Meta Uses

func (it *Iter) Meta() *ListMeta

Meta returns the list metadata.

func (*Iter) Next Uses

func (it *Iter) Next() bool

Next advances the Iter to the next item in the list, which will then be available through the Current method. It returns false when the iterator stops at the end of the list.

type Level Uses

type Level uint32

Level represents a logging level.

const (
    // LevelError sets a logger to show error messages only.
    LevelError Level = 1

    // LevelWarn sets a logger to show warning messages or anything more
    // severe.
    LevelWarn Level = 2

    // LevelInfo sets a logger to show informational messages or anything more
    // severe.
    LevelInfo Level = 3

    // LevelDebug sets a logger to show informational messages or anything more
    // severe.
    LevelDebug Level = 4
)

type LeveledLogger Uses

type LeveledLogger struct {
    // Level is the minimum logging level that will be emitted by this logger.
    //
    // For example, a Level set to LevelWarn will emit warnings and errors, but
    // not informational or debug messages.
    //
    // Always set this with a constant like LevelWarn because the individual
    // values are not guaranteed to be stable.
    Level Level
    // contains filtered or unexported fields
}

LeveledLogger is a leveled logger implementation.

It prints warnings and errors to `os.Stderr` and other messages to `os.Stdout`.

func (*LeveledLogger) Debugf Uses

func (l *LeveledLogger) Debugf(format string, v ...interface{})

Debugf logs a debug message using Printf conventions.

func (*LeveledLogger) Errorf Uses

func (l *LeveledLogger) Errorf(format string, v ...interface{})

Errorf logs a warning message using Printf conventions.

func (*LeveledLogger) Infof Uses

func (l *LeveledLogger) Infof(format string, v ...interface{})

Infof logs an informational message using Printf conventions.

func (*LeveledLogger) Warnf Uses

func (l *LeveledLogger) Warnf(format string, v ...interface{})

Warnf logs a warning message using Printf conventions.

type LeveledLoggerInterface Uses

type LeveledLoggerInterface interface {
    // Debugf logs a debug message using Printf conventions.
    Debugf(format string, v ...interface{})

    // Errorf logs a warning message using Printf conventions.
    Errorf(format string, v ...interface{})

    // Infof logs an informational message using Printf conventions.
    Infof(format string, v ...interface{})

    // Warnf logs a warning message using Printf conventions.
    Warnf(format string, v ...interface{})
}

LeveledLoggerInterface provides a basic leveled logging interface for printing debug, informational, warning, and error messages.

It's implemented by LeveledLogger and also provides out-of-the-box compatibility with a Logrus Logger, but may require a thin shim for use with other logging libraries that you use less standard conventions like Zap.

var DefaultLeveledLogger LeveledLoggerInterface

DefaultLeveledLogger is the default logger that the library will use to log errors, warnings, and informational messages.

LeveledLoggerInterface is implemented by LeveledLogger, and one can be initialized at the desired level of logging. LeveledLoggerInterface also provides out-of-the-box compatibility with a Logrus Logger, but may require a thin shim for use with other logging libraries that use less standard conventions like Zap.

This Logger will be inherited by any backends created by default, but will be overridden if a backend is created with GetBackendWithConfig with a custom LeveledLogger set.

type ListMeta Uses

type ListMeta struct {
    HasMore    bool   `json:"has_more"`
    TotalCount uint32 `json:"total_count"`
    URL        string `json:"url"`
}

ListMeta is the structure that contains the common properties of List iterators. The Count property is only populated if the total_count include option is passed in (see tests for example).

type ListParams Uses

type ListParams struct {
    // Context used for request. It may carry deadlines, cancelation signals,
    // and other request-scoped values across API boundaries and between
    // processes.
    //
    // Note that a cancelled or timed out context does not provide any
    // guarantee whether the operation was or was not completed on Stripe's API
    // servers. For certainty, you must either retry with the same idempotency
    // key or query the state of the API.
    Context context.Context `form:"-"`

    EndingBefore *string   `form:"ending_before"`
    Expand       []*string `form:"expand"`
    Filters      Filters   `form:"*"`
    Limit        *int64    `form:"limit"`

    // Single specifies whether this is a single page iterator. By default,
    // listing through an iterator will automatically grab additional pages as
    // the query progresses. To change this behavior and just load a single
    // page, set this to true.
    Single bool `form:"-"` // Not an API parameter

    StartingAfter *string `form:"starting_after"`

    // StripeAccount may contain the ID of a connected account. By including
    // this field, the request is made as if it originated from the connected
    // account instead of under the account of the owner of the configured
    // Stripe key.
    StripeAccount *string `form:"-"` // Passed as header
}

ListParams is the structure that contains the common properties of any *ListParams structure.

func (*ListParams) AddExpand Uses

func (p *ListParams) AddExpand(f string)

AddExpand appends a new field to expand.

func (*ListParams) GetListParams Uses

func (p *ListParams) GetListParams() *ListParams

GetListParams returns a ListParams struct (itself). It exists because any structs that embed ListParams will inherit it, and thus implement the ListParamsContainer interface.

func (*ListParams) GetParams Uses

func (p *ListParams) GetParams() *Params

GetParams returns ListParams as a Params struct. It exists because any structs that embed Params will inherit it, and thus implement the ParamsContainer interface.

func (*ListParams) SetStripeAccount Uses

func (p *ListParams) SetStripeAccount(val string)

SetStripeAccount sets a value for the Stripe-Account header.

func (*ListParams) ToParams Uses

func (p *ListParams) ToParams() *Params

ToParams converts a ListParams to a Params by moving over any fields that have valid targets in the new type. This is useful because fields in Params can be injected directly into an http.Request while generally ListParams is only used to build a set of parameters.

type ListParamsContainer Uses

type ListParamsContainer interface {
    GetListParams() *ListParams
}

ListParamsContainer is a general interface for which all list parameter structs should comply. They achieve this by embedding a ListParams struct and inheriting its implementation of this interface.

type LoginLink struct {
    Created int64  `json:"created"`
    URL     string `json:"url"`
}

LoginLink is the resource representing a login link for Express accounts. For more details see https://stripe.com/docs/api#login_link_object

type LoginLinkParams Uses

type LoginLinkParams struct {
    Params      `form:"*"`
    Account     *string `form:"-"` // Included in URL
    RedirectURL *string `form:"redirect_url"`
}

LoginLinkParams is the set of parameters that can be used when creating a login_link. For more details see https://stripe.com/docs/api#create_login_link.

type Mandate Uses

type Mandate struct {
    CustomerAcceptance   *MandateCustomerAcceptance   `json:"customer_acceptance"`
    ID                   string                       `json:"id"`
    Livemode             bool                         `json:"livemode"`
    MultiUse             *MandateMultiUse             `json:"multi_use"`
    Object               string                       `json:"object"`
    PaymentMethod        *PaymentMethod               `json:"payment_method"`
    PaymentMethodDetails *MandatePaymentMethodDetails `json:"payment_method_details"`
    SingleUse            *MandateSingleUse            `json:"single_use"`
    Status               MandateStatus                `json:"status"`
    Type                 MandateType                  `json:"type"`
}

Mandate is the resource representing a Mandate.

func (*Mandate) UnmarshalJSON Uses

func (i *Mandate) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Mandate. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type MandateCustomerAcceptance Uses

type MandateCustomerAcceptance struct {
    AcceptedAt int64                             `json:"accepted_at"`
    Offline    *MandateCustomerAcceptanceOffline `json:"offline"`
    Online     *MandateCustomerAcceptanceOnline  `json:"online"`
    Type       MandateCustomerAcceptanceType     `json:"type"`
}

MandateCustomerAcceptance represents details about the customer acceptance for a mandate.

type MandateCustomerAcceptanceOffline Uses

type MandateCustomerAcceptanceOffline struct {
}

MandateCustomerAcceptanceOffline represents details about the customer acceptance of an offline mandate.

type MandateCustomerAcceptanceOnline Uses

type MandateCustomerAcceptanceOnline struct {
    IPAddress string `json:"ip_address"`
    UserAgent string `json:"user_agent"`
}

MandateCustomerAcceptanceOnline represents details about the customer acceptance of an online mandate.

type MandateCustomerAcceptanceType Uses

type MandateCustomerAcceptanceType string

MandateCustomerAcceptanceType is the list of allowed values for the type of customer acceptance for a given mandate..

const (
    MandateCustomerAcceptanceTypeOffline MandateCustomerAcceptanceType = "offline"
    MandateCustomerAcceptanceTypeOnline  MandateCustomerAcceptanceType = "online"
)

List of values that MandateStatus can take.

type MandateMultiUse Uses

type MandateMultiUse struct {
}

MandateMultiUse represents details about a multi-use mandate.

type MandateParams Uses

type MandateParams struct {
    Params `form:"*"`
}

MandateParams is the set of parameters that can be used when retrieving a mandate.

type MandatePaymentMethodDetails Uses

type MandatePaymentMethodDetails struct {
    Card      *MandatePaymentMethodDetailsCard      `json:"card"`
    SepaDebit *MandatePaymentMethodDetailsSepaDebit `json:"sepa_debit"`
    Type      PaymentMethodType                     `json:"type"`
}

MandatePaymentMethodDetails represents details about the payment method associated with this mandate.

type MandatePaymentMethodDetailsCard Uses

type MandatePaymentMethodDetailsCard struct {
}

MandatePaymentMethodDetailsCard represents details about the card associated with this mandate.

type MandatePaymentMethodDetailsSepaDebit Uses

type MandatePaymentMethodDetailsSepaDebit struct {
    Reference string `json:"reference"`
    URL       string `json:"url"`
}

MandatePaymentMethodDetailsSepaDebit represents details about the SEPA debit bank account associated with this mandate.

type MandateSingleUse Uses

type MandateSingleUse struct {
    Amount   int64    `json:"amount"`
    Currency Currency `json:"currency"`
}

MandateSingleUse represents details about a single-use mandate.

type MandateStatus Uses

type MandateStatus string

MandateStatus is the list of allowed values for the mandate status.

const (
    MandateStatusActive   MandateStatus = "active"
    MandateStatusInactive MandateStatus = "inactive"
    MandateStatusPending  MandateStatus = "pending"
)

List of values that MandateStatus can take.

type MandateType Uses

type MandateType string

MandateType is the list of allowed values for the mandate type.

const (
    MandateTypeMultiUse  MandateType = "multi_use"
    MandateTypeSingleUse MandateType = "single_use"
)

List of values that MandateType can take.

type OAuthScopeType Uses

type OAuthScopeType string

OAuthScopeType is the type of OAuth scope.

const (
    OAuthScopeTypeReadOnly  OAuthScopeType = "read_only"
    OAuthScopeTypeReadWrite OAuthScopeType = "read_write"
)

List of possible values for OAuth scopes.

type OAuthStripeUserBusinessType Uses

type OAuthStripeUserBusinessType string

OAuthStripeUserBusinessType is the business type for the Stripe oauth user.

const (
    OAuthStripeUserBusinessTypeCorporation OAuthStripeUserBusinessType = "corporation"
    OAuthStripeUserBusinessTypeLLC         OAuthStripeUserBusinessType = "llc"
    OAuthStripeUserBusinessTypeNonProfit   OAuthStripeUserBusinessType = "non_profit"
    OAuthStripeUserBusinessTypePartnership OAuthStripeUserBusinessType = "partnership"
    OAuthStripeUserBusinessTypeSoleProp    OAuthStripeUserBusinessType = "sole_prop"
)

List of supported values for business type.

type OAuthStripeUserGender Uses

type OAuthStripeUserGender string

OAuthStripeUserGender of the person who will be filling out a Stripe application. (International regulations require either male or female.)

const (
    OAuthStripeUserGenderFemale OAuthStripeUserGender = "female"
    OAuthStripeUserGenderMale   OAuthStripeUserGender = "male"
)

The gender of the person who will be filling out a Stripe application. (International regulations require either male or female.)

type OAuthStripeUserParams Uses

type OAuthStripeUserParams struct {
    BlockKana          *string `form:"block_kana"`
    BlockKanji         *string `form:"block_kanji"`
    BuildingKana       *string `form:"building_kana"`
    BuildingKanji      *string `form:"building_kanji"`
    BusinessName       *string `form:"business_name"`
    BusinessType       *string `form:"business_type"`
    City               *string `form:"city"`
    Country            *string `form:"country"`
    Currency           *string `form:"currency"`
    DOBDay             *int64  `form:"dob_day"`
    DOBMonth           *int64  `form:"dob_month"`
    DOBYear            *int64  `form:"dob_year"`
    Email              *string `form:"email"`
    FirstName          *string `form:"first_name"`
    FirstNameKana      *string `form:"first_name_kana"`
    FirstNameKanji     *string `form:"first_name_kanji"`
    Gender             *string `form:"gender"`
    LastName           *string `form:"last_name"`
    LastNameKana       *string `form:"last_name_kana"`
    LastNameKanji      *string `form:"last_name_kanji"`
    PhoneNumber        *string `form:"phone_number"`
    PhysicalProduct    *bool   `form:"physical_product"`
    ProductDescription *string `form:"product_description"`
    State              *string `form:"state"`
    StreetAddress      *string `form:"street_address"`
    URL                *string `form:"url"`
    Zip                *string `form:"zip"`
}

OAuthStripeUserParams for the stripe_user OAuth Authorize params.

type OAuthToken Uses

type OAuthToken struct {
    Livemode     bool           `json:"livemode"`
    Scope        OAuthScopeType `json:"scope"`
    StripeUserID string         `json:"stripe_user_id"`
    TokenType    OAuthTokenType `json:"token_type"`

    // Deprecated, please use StripeUserID
    AccessToken          string `json:"access_token"`
    RefreshToken         string `json:"refresh_token"`
    StripePublishableKey string `json:"stripe_publishable_key"`
}

OAuthToken is the value of the OAuthToken from OAuth flow. https://stripe.com/docs/connect/oauth-reference#post-token

type OAuthTokenParams Uses

type OAuthTokenParams struct {
    Params             `form:"*"`
    AssertCapabilities []*string `form:"assert_capabilities"`
    ClientSecret       *string   `form:"client_secret"`
    Code               *string   `form:"code"`
    GrantType          *string   `form:"grant_type"`
    RefreshToken       *string   `form:"refresh_token"`
    Scope              *string   `form:"scope"`
}

OAuthTokenParams is the set of paramaters that can be used to request OAuthTokens.

type OAuthTokenType Uses

type OAuthTokenType string

OAuthTokenType is the type of token. This will always be "bearer."

const (
    OAuthTokenTypeBearer OAuthTokenType = "bearer"
)

List of possible OAuthTokenType values.

type Order Uses

type Order struct {
    Amount                 int64             `json:"amount"`
    AmountReturned         int64             `json:"amount_returned"`
    Application            string            `json:"application"`
    ApplicationFee         int64             `json:"application_fee"`
    Charge                 *Charge           `json:"charge"`
    Created                int64             `json:"created"`
    Currency               Currency          `json:"currency"`
    Customer               Customer          `json:"customer"`
    Email                  string            `json:"email"`
    ID                     string            `json:"id"`
    Items                  []*OrderItem      `json:"items"`
    Livemode               bool              `json:"livemode"`
    Metadata               map[string]string `json:"metadata"`
    Returns                *OrderReturnList  `json:"returns"`
    SelectedShippingMethod *string           `json:"selected_shipping_method"`
    Shipping               *Shipping         `json:"shipping"`
    ShippingMethods        []*ShippingMethod `json:"shipping_methods"`
    Status                 string            `json:"status"`
    StatusTransitions      StatusTransitions `json:"status_transitions"`
    Updated                int64             `json:"updated"`
    UpstreamID             string            `json:"upstream_id"`
}

Order is the resource representing a Stripe charge. For more details see https://stripe.com/docs/api#orders.

func (*Order) UnmarshalJSON Uses

func (o *Order) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an Order. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type OrderDeliveryEstimateType Uses

type OrderDeliveryEstimateType string

OrderDeliveryEstimateType represents the type of delivery estimate for shipping methods

const (
    OrderDeliveryEstimateTypeExact OrderDeliveryEstimateType = "exact"
    OrderDeliveryEstimateTypeRange OrderDeliveryEstimateType = "range"
)

List of values that OrderDeliveryEstimateType can take.

type OrderItem Uses

type OrderItem struct {
    Amount      int64            `json:"amount"`
    Currency    Currency         `json:"currency"`
    Description string           `json:"description"`
    Parent      *OrderItemParent `json:"parent"`
    Quantity    int64            `json:"quantity"`
    Type        OrderItemType    `json:"type"`
}

OrderItem is the resource representing an order item.

type OrderItemParams Uses

type OrderItemParams struct {
    Amount      *int64  `form:"amount"`
    Currency    *string `form:"currency"`
    Description *string `form:"description"`
    Parent      *string `form:"parent"`
    Quantity    *int64  `form:"quantity"`
    Type        *string `form:"type"`
}

OrderItemParams is the set of parameters describing an order item on order creation or update.

type OrderItemParent Uses

type OrderItemParent struct {
    ID   string              `json:"id"`
    SKU  *SKU                `json:"-"`
    Type OrderItemParentType `json:"object"`
}

OrderItemParent describes the parent of an order item.

func (*OrderItemParent) UnmarshalJSON Uses

func (p *OrderItemParent) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an OrderItemParent. This custom unmarshaling is needed because the resulting property may be an id or a full SKU struct if it was expanded.

type OrderItemParentType Uses

type OrderItemParentType string

OrderItemParentType represents the type of order item parent

const (
    OrderItemParentTypeCoupon   OrderItemParentType = "coupon"
    OrderItemParentTypeDiscount OrderItemParentType = "discount"
    OrderItemParentTypeSKU      OrderItemParentType = "sku"
    OrderItemParentTypeShipping OrderItemParentType = "shipping"
    OrderItemParentTypeTax      OrderItemParentType = "tax"
)

List of values that OrderItemParentType can take.

type OrderItemType Uses

type OrderItemType string

OrderItemType represents the type of order item

const (
    OrderItemTypeCoupon   OrderItemType = "coupon"
    OrderItemTypeDiscount OrderItemType = "discount"
    OrderItemTypeSKU      OrderItemType = "sku"
    OrderItemTypeShipping OrderItemType = "shipping"
    OrderItemTypeTax      OrderItemType = "tax"
)

List of values that OrderItemType can take.

type OrderList Uses

type OrderList struct {
    ListMeta
    Data []*Order `json:"data"`
}

OrderList is a list of orders as retrieved from a list endpoint.

type OrderListParams Uses

type OrderListParams struct {
    ListParams        `form:"*"`
    Created           *int64                         `form:"created"`
    CreatedRange      *RangeQueryParams              `form:"created"`
    Customer          *string                        `form:"customer"`
    IDs               []*string                      `form:"ids"`
    Status            *string                        `form:"status"`
    StatusTransitions *StatusTransitionsFilterParams `form:"status_transitions"`
    UpstreamIDs       []*string                      `form:"upstream_ids"`
}

OrderListParams is the set of parameters that can be used when listing orders.

type OrderParams Uses

type OrderParams struct {
    Params   `form:"*"`
    Coupon   *string            `form:"coupon"`
    Currency *string            `form:"currency"`
    Customer *string            `form:"customer"`
    Email    *string            `form:"email"`
    Items    []*OrderItemParams `form:"items"`
    Shipping *ShippingParams    `form:"shipping"`
}

OrderParams is the set of parameters that can be used when creating an order.

type OrderPayParams Uses

type OrderPayParams struct {
    Params         `form:"*"`
    ApplicationFee *int64        `form:"application_fee"`
    Customer       *string       `form:"customer"`
    Email          *string       `form:"email"`
    Source         *SourceParams `form:"*"` // SourceParams has custom encoding so brought to top level with "*"
}

OrderPayParams is the set of parameters that can be used when paying orders.

func (*OrderPayParams) SetSource Uses

func (op *OrderPayParams) SetSource(sp interface{}) error

SetSource adds valid sources to a OrderParams object, returning an error for unsupported sources.

type OrderReturn Uses

type OrderReturn struct {
    Amount   int64        `json:"amount"`
    Created  int64        `json:"created"`
    Currency Currency     `json:"currency"`
    ID       string       `json:"id"`
    Items    []*OrderItem `json:"items"`
    Livemode bool         `json:"livemode"`
    Order    *Order       `json:"order"`
    Refund   *Refund      `json:"refund"`
}

OrderReturn is the resource representing an order return. For more details see https://stripe.com/docs/api#order_returns.

func (*OrderReturn) UnmarshalJSON Uses

func (r *OrderReturn) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of an OrderReturn. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type OrderReturnList Uses

type OrderReturnList struct {
    ListMeta
    Data []*OrderReturn `json:"data"`
}

OrderReturnList is a list of order returns as retrieved from a list endpoint.

type OrderReturnListParams Uses

type OrderReturnListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Order        *string           `form:"order"`
}

OrderReturnListParams is the set of parameters that can be used when listing order returns.

type OrderReturnParams Uses

type OrderReturnParams struct {
    Params `form:"*"`
    Items  []*OrderItemParams `form:"items"`
    Order  *string            `form:"-"` // Included in the URL
}

OrderReturnParams is the set of parameters that can be used when returning orders.

type OrderStatus Uses

type OrderStatus string

OrderStatus represents the statuses of an order object.

const (
    OrderStatusCanceled  OrderStatus = "canceled"
    OrderStatusCreated   OrderStatus = "created"
    OrderStatusFulfilled OrderStatus = "fulfilled"
    OrderStatusPaid      OrderStatus = "paid"
    OrderStatusReturned  OrderStatus = "returned"
)

List of values that OrderStatus can take.

type OrderUpdateParams Uses

type OrderUpdateParams struct {
    Params                 `form:"*"`
    Coupon                 *string                    `form:"coupon"`
    SelectedShippingMethod *string                    `form:"selected_shipping_method"`
    Shipping               *OrderUpdateShippingParams `form:"shipping"`
    Status                 *string                    `form:"status"`
}

OrderUpdateParams is the set of parameters that can be used when updating an order.

type OrderUpdateShippingParams Uses

type OrderUpdateShippingParams struct {
    Carrier        *string `form:"carrier"`
    TrackingNumber *string `form:"tracking_number"`
}

OrderUpdateShippingParams is the set of parameters that can be used for the shipping hash on order update.

type PIIParams Uses

type PIIParams struct {
    Params   `form:"*"`
    IDNumber *string `form:"id_number"`
}

PIIParams are parameters for personal identifiable information (PII).

type PackageDimensions Uses

type PackageDimensions struct {
    Height float64 `json:"height"`
    Length float64 `json:"length"`
    Weight float64 `json:"weight"`
    Width  float64 `json:"width"`
}

PackageDimensions represents the dimension of a product or a SKU from the perspective of shipping.

type PackageDimensionsParams Uses

type PackageDimensionsParams struct {
    Height *float64 `form:"height"`
    Length *float64 `form:"length"`
    Weight *float64 `form:"weight"`
    Width  *float64 `form:"width"`
}

PackageDimensionsParams represents the set of parameters for the the dimension of a product or a SKU from the perspective of shipping .

type Params Uses

type Params struct {
    // Context used for request. It may carry deadlines, cancelation signals,
    // and other request-scoped values across API boundaries and between
    // processes.
    //
    // Note that a cancelled or timed out context does not provide any
    // guarantee whether the operation was or was not completed on Stripe's API
    // servers. For certainty, you must either retry with the same idempotency
    // key or query the state of the API.
    Context context.Context `form:"-"`

    Expand []*string    `form:"expand"`
    Extra  *ExtraValues `form:"*"`

    // Headers may be used to provide extra header lines on the HTTP request.
    Headers http.Header `form:"-"`

    IdempotencyKey *string           `form:"-"` // Passed as header
    Metadata       map[string]string `form:"metadata"`

    // StripeAccount may contain the ID of a connected account. By including
    // this field, the request is made as if it originated from the connected
    // account instead of under the account of the owner of the configured
    // Stripe key.
    StripeAccount *string `form:"-"` // Passed as header
}

Params is the structure that contains the common properties of any *Params structure.

func (*Params) AddExpand Uses

func (p *Params) AddExpand(f string)

AddExpand appends a new field to expand.

func (*Params) AddExtra Uses

func (p *Params) AddExtra(key, value string)

AddExtra adds a new arbitrary key-value pair to the request data

func (*Params) AddMetadata Uses

func (p *Params) AddMetadata(key, value string)

AddMetadata adds a new key-value pair to the Metadata.

func (*Params) GetParams Uses

func (p *Params) GetParams() *Params

GetParams returns a Params struct (itself). It exists because any structs that embed Params will inherit it, and thus implement the ParamsContainer interface.

func (*Params) SetIdempotencyKey Uses

func (p *Params) SetIdempotencyKey(val string)

SetIdempotencyKey sets a value for the Idempotency-Key header.

func (*Params) SetStripeAccount Uses

func (p *Params) SetStripeAccount(val string)

SetStripeAccount sets a value for the Stripe-Account header.

type ParamsContainer Uses

type ParamsContainer interface {
    GetParams() *Params
}

ParamsContainer is a general interface for which all parameter structs should comply. They achieve this by embedding a Params struct and inheriting its implementation of this interface.

type PaymentIntent Uses

type PaymentIntent struct {
    Amount                    int64                              `json:"amount"`
    AmountCapturable          int64                              `json:"amount_capturable"`
    AmountReceived            int64                              `json:"amount_received"`
    Application               *Application                       `json:"application"`
    ApplicationFeeAmount      int64                              `json:"application_fee_amount"`
    CanceledAt                int64                              `json:"canceled_at"`
    CancellationReason        PaymentIntentCancellationReason    `json:"cancellation_reason"`
    CaptureMethod             PaymentIntentCaptureMethod         `json:"capture_method"`
    Charges                   *ChargeList                        `json:"charges"`
    ClientSecret              string                             `json:"client_secret"`
    ConfirmationMethod        PaymentIntentConfirmationMethod    `json:"confirmation_method"`
    Created                   int64                              `json:"created"`
    Currency                  string                             `json:"currency"`
    Customer                  *Customer                          `json:"customer"`
    Description               string                             `json:"description"`
    Invoice                   *Invoice                           `json:"invoice"`
    LastPaymentError          *Error                             `json:"last_payment_error"`
    Livemode                  bool                               `json:"livemode"`
    ID                        string                             `json:"id"`
    Metadata                  map[string]string                  `json:"metadata"`
    NextAction                *PaymentIntentNextAction           `json:"next_action"`
    OnBehalfOf                *Account                           `json:"on_behalf_of"`
    PaymentMethod             *PaymentMethod                     `json:"payment_method"`
    PaymentMethodOptions      *PaymentIntentPaymentMethodOptions `json:"payment_method_options"`
    PaymentMethodTypes        []string                           `json:"payment_method_types"`
    ReceiptEmail              string                             `json:"receipt_email"`
    Review                    *Review                            `json:"review"`
    SetupFutureUsage          PaymentIntentSetupFutureUsage      `json:"setup_future_usage"`
    Shipping                  ShippingDetails                    `json:"shipping"`
    Source                    *PaymentSource                     `json:"source"`
    StatementDescriptor       string                             `json:"statement_descriptor"`
    StatementDescriptorSuffix string                             `json:"statement_descriptor_suffix"`
    Status                    PaymentIntentStatus                `json:"status"`
    TransferData              *PaymentIntentTransferData         `json:"transfer_data"`
    TransferGroup             string                             `json:"transfer_group"`
}

PaymentIntent is the resource representing a Stripe payout. For more details see https://stripe.com/docs/api#payment_intents.

func (*PaymentIntent) UnmarshalJSON Uses

func (p *PaymentIntent) UnmarshalJSON(data []byte) error

UnmarshalJSON handles deserialization of a Payment Intent. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.

type PaymentIntentCancelParams Uses

type PaymentIntentCancelParams struct {
    Params             `form:"*"`
    CancellationReason *string `form:"cancellation_reason"`
}

PaymentIntentCancelParams is the set of parameters that can be used when canceling a payment intent.

type PaymentIntentCancellationReason Uses

type PaymentIntentCancellationReason string

PaymentIntentCancellationReason is the list of allowed values for the cancelation reason.

const (
    PaymentIntentCancellationReasonAbandoned           PaymentIntentCancellationReason = "abandoned"
    PaymentIntentCancellationReasonAutomatic           PaymentIntentCancellationReason = "automatic"
    PaymentIntentCancellationReasonDuplicate           PaymentIntentCancellationReason = "duplicate"
    PaymentIntentCancellationReasonFailedInvoice       PaymentIntentCancellationReason = "failed_invoice"
    PaymentIntentCancellationReasonFraudulent          PaymentIntentCancellationReason = "fraudulent"
    PaymentIntentCancellationReasonRequestedByCustomer PaymentIntentCancellationReason = "requested_by_customer"
    PaymentIntentCancellationReasonVoidInvoice         PaymentIntentCancellationReason = "void_invoice"
)

List of values that PaymentIntentCancellationReason can take.

type PaymentIntentCaptureMethod Uses

type PaymentIntentCaptureMethod string

PaymentIntentCaptureMethod is the list of allowed values for the capture method.

const (
    PaymentIntentCaptureMethodAutomatic PaymentIntentCaptureMethod = "automatic"
    PaymentIntentCaptureMethodManual    PaymentIntentCaptureMethod = "manual"
)

List of values that PaymentIntentCaptureMethod can take.

type PaymentIntentCaptureParams Uses

type PaymentIntentCaptureParams struct {
    Params                    `form:"*"`
    AmountToCapture           *int64                           `form:"amount_to_capture"`
    ApplicationFeeAmount      *int64                           `form:"application_fee_amount"`
    StatementDescriptor       *string                          `form:"statement_descriptor"`
    StatementDescriptorSuffix *string                          `form:"statement_descriptor_suffix"`
    TransferData              *PaymentIntentTransferDataParams `form:"transfer_data"`
}

PaymentIntentCaptureParams is the set of parameters that can be used when capturing a payment intent.

type PaymentIntentConfirmParams Uses

type PaymentIntentConfirmParams struct {
    Params               `form:"*"`
    Mandate              *string                                  `form:"mandate"`
    MandateData          *PaymentIntentMandateDataParams          `form:"mandate_data"`
    OffSession           *bool                                    `form:"off_session"`
    PaymentMethod        *string                                  `form:"payment_method"`
    PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
    PaymentMethodTypes   []*string                                `form:"payment_method_types"`
    ReceiptEmail         *string                                  `form:"receipt_email"`
    ReturnURL            *string                                  `form:"return_url"`
    SavePaymentMethod    *bool                                    `form:"save_payment_method"`
    SetupFutureUsage     *string                                  `form:"setup_future_usage"`
    Shipping             *ShippingDetailsParams                   `form:"shipping"`
    Source               *string                                  `form:"source"`
    UseStripeSDK         *bool                                    `form:"use_stripe_sdk"`
}

PaymentIntentConfirmParams is the set of parameters that can be used when confirming a payment intent.

type PaymentIntentConfirmationMethod Uses

type PaymentIntentConfirmationMethod string

PaymentIntentConfirmationMethod is the list of allowed values for the confirmation method.

const (
    PaymentIntentConfirmationMethodAutomatic PaymentIntentConfirmationMethod = "automatic"
    PaymentIntentConfirmationMethodManual    PaymentIntentConfirmationMethod = "manual"
)

List of values that PaymentIntentConfirmationMethod can take.

type PaymentIntentList Uses

type PaymentIntentList struct {
    ListMeta
    Data []*PaymentIntent `json:"data"`
}

PaymentIntentList is a list of payment intents as retrieved from a list endpoint.

type PaymentIntentListParams Uses

type PaymentIntentListParams struct {
    ListParams   `form:"*"`
    Created      *int64            `form:"created"`
    CreatedRange *RangeQueryParams `form:"created"`
    Customer     *string           `form:"customer"`
}

PaymentIntentListParams is the set of parameters that can be used when listing payment intents. For more details see https://stripe.com/docs/api#list_payouts.

type PaymentIntentMandateDataCustomerAcceptanceOfflineParams Uses

type PaymentIntentMandateDataCustomerAcceptanceOfflineParams struct {
}

PaymentIntentMandateDataCustomerAcceptanceOfflineParams is the set of parameters for the customer acceptance of an offline mandate.

type PaymentIntentMandateDataCustomerAcceptanceOnlineParams Uses

type PaymentIntentMandateDataCustomerAcceptanceOnlineParams struct {
    IPAddress *string `form:"ip_address"`
    UserAgent *string `form:"user_agent"`
}

PaymentIntentMandateDataCustomerAcceptanceOnlineParams is the set of parameters for the customer acceptance of an online mandate.

type PaymentIntentMandateDataCustomerAcceptanceParams Uses

type PaymentIntentMandateDataCustomerAcceptanceParams struct {
    AcceptedAt int64                                                    `form:"accepted_at"`
    Offline    *PaymentIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline"`
    Online     *PaymentIntentMandateDataCustomerAcceptanceOnlineParams  `form:"online"`
    Type       MandateCustomerAcceptanceType                            `form:"type"`
}

PaymentIntentMandateDataCustomerAcceptanceParams is the set of parameters for the customer acceptance of a mandate.

type PaymentIntentMandateDataParams Uses

type PaymentIntentMandateDataParams struct {
    CustomerAcceptance *PaymentIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"`
}

PaymentIntentMandateDataParams is the set of parameters controlling the creation of the mandate associated with this PaymentIntent.

type PaymentIntentNextAction Uses

type PaymentIntentNextAction struct {
    RedirectToURL *PaymentIntentNextActionRedirectToURL `json:"redirect_to_url"`
    Type          PaymentIntentNextActionType           `json:"type"`
}

PaymentIntentNextAction represents the type of action to take on a payment intent.

type PaymentIntentNextActionRedirectToURL Uses

type PaymentIntentNextActionRedirectToURL struct {
    ReturnURL string `json:"return_url"`
    URL       string `json:"url"`
}

PaymentIntentNextActionRedirectToURL represents the resource for the next action of type "redirect_to_url".

type PaymentIntentNextActionType Uses

type PaymentIntentNextActionType string

PaymentIntentNextActionType is the list of allowed values for the next action's type.

const (
    PaymentIntentNextActionTypeRedirectToURL PaymentIntentNextActionType = "redirect_to_url"
)

List of values that PaymentIntentNextActionType can take.

type PaymentIntentOffSession Uses

type PaymentIntentOffSession string

PaymentIntentOffSession is the list of allowed values for types of off-session.

const (
    PaymentIntentOffSessionOneOff    PaymentIntentOffSession = "one_off"
    PaymentIntentOffSessionRecurring PaymentIntentOffSession = "recurring"
)

List of values that PaymentIntentOffSession can take.

type PaymentIntentParams Uses

type PaymentIntentParams struct {
    Params                    `form:"*"`
    Amount                    *int64                                   `form:"amount"`
    ApplicationFeeAmount      *int64                                   `form:"application_fee_amount"`
    CaptureMethod             *string                                  `form:"capture_method"`
    Confirm                   *bool                                    `form:"confirm"`
    ConfirmationMethod        *string                                  `form:"confirmation_method"`
    Currency                  *string                                  `form:"currency"`
    Customer                  *string                                  `form:"customer"`
    Description               *string                                  `form:"description"`
    Mandate                   *string                                  `form:"mandate"`
    MandateData               *PaymentIntentMandateDataParams          `form:"mandate_data"`
    OnBehalfOf                *string                                  `form:"on_behalf_of"`
    PaymentMethod             *string                                  `form:"payment_method"`
    PaymentMethodOptions      *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
    PaymentMethodTypes        []*string                                `form:"payment_method_types"`
    ReceiptEmail              *string                                  `form:"receipt_email"`
    ReturnURL                 *string                                  `form:"return_url"`
    SavePaymentMethod         *bool                                    `form:"save_payment_method"`
    SetupFutureUsage          *string                                  `form:"setup_future_usage"`
    Shipping                  *ShippingDetailsParams                   `form:"shipping"`
    Source                    *string                                  `form:"source"`
    StatementDescriptor       *string                                  `form:"statement_descriptor"`
    StatementDescriptorSuffix *string                                  `form:"statement_descriptor_suffix"`
    TransferData              *PaymentIntentTransferDataParams         `form:"transfer_data"`
    TransferGroup             *string                                  `form:"transfer_group"`

    // Those parameters only works if you confirm on creation.
    OffSession   *bool `form:"off_session"`
    UseStripeSDK *bool `form:"use_stripe_sdk"`
}

PaymentIntentParams is the set of parameters that can be used when handling a payment intent.

type PaymentIntentPaymentMethodOptions Uses

type PaymentIntentPaymentMethodOptions struct {
    Card *PaymentIntentPaymentMethodOptionsCard `json:"card"`
}

PaymentIntentPaymentMethodOptions is the set of payment method-specific options associated with that payment intent.

type PaymentIntentPaymentMethodOptionsCard Uses

type PaymentIntentPaymentMethodOptionsCard struct {
    Installments        *PaymentIntentPaymentMethodOptionsCardInstallments       `json:"installments"`
    RequestThreeDSecure PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"`
}

PaymentIntentPaymentMethodOptionsCard is the set of card-specific options associated with that payment intent.

type PaymentIntentPaymentMethodOptionsCardInstallments Uses

type PaymentIntentPaymentMethodOptionsCardInstallments struct {
    AvailablePlans []*PaymentIntentPaymentMethodOptionsCardInstallmentsPlan `json:"available_plans"`
    Enabled        bool                                                     `json:"enabled"`
    Plan           *PaymentIntentPaymentMethodOptionsCardInstallmentsPlan   `json:"plan"`
}

PaymentIntentPaymentMethodOptionsCardInstallments describe the installment options available for a card associated with that payment intent.

type PaymentIntentPaymentMethodOptionsCardInstallmentsParams Uses

type PaymentIntentPaymentMethodOptionsCardInstallmentsParams struct {
    Enabled *bool                                                        `form:"enabled"`
    Plan    *PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams `form:"plan"`
}

PaymentIntentPaymentMethodOptionsCardInstallmentsParams controls whether to enable installment plans for this payment intent.

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlan Uses

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlan struct {
    Count    int64                                                         `json:"count"`
    Interval PaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval `json:"interval"`
    Type     PaymentIntentPaymentMethodOptionsCardInstallmentsPlanType     `json:"type"`
}

PaymentIntentPaymentMethodOptionsCardInstallmentsPlan describe a specific card installment plan.

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval Uses

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval string

PaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval is the interval of a card installment plan.

const (
    PaymentIntentPaymentMethodOptionsCardInstallmentsPlanIntervalMonth PaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval = "month"
)

List of values that PaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval can take.

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams Uses

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams struct {
    Count    *int64  `form:"count"`
    Interval *string `form:"interval"`
    Type     *string `form:"type"`
}

PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams represents details about the installment plan chosen for this payment intent.

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanType Uses

type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanType string

PaymentIntentPaymentMethodOptionsCardInstallmentsPlanType is the type of a card installment plan.

const (
    PaymentIntentPaymentMethodOptionsCardInstallmentsPlanTypeFixedCount PaymentIntentPaymentMethodOptionsCardInstallmentsPlanType = "fixed_count"
)

List of values that PaymentIntentPaymentMethodOptionsCardInstallmentsPlanType can take.

type PaymentIntentPaymentMethodOptionsCardParams Uses

type PaymentIntentPaymentMethodOptionsCardParams struct {
    Installments        *PaymentIntentPaymentMethodOptionsCardInstallmentsParams `form:"installments"`
    MOTO                *bool                                                    `form:"moto"`
    RequestThreeDSecure *string                                                  `form:"request_three_d_secure"`
}

PaymentIntentPaymentMethodOptionsCardParams represents the card-specific options applied to a PaymentIntent.

type PaymentIntentPaymentMethodOptionsCardRequest