Documentation ¶
Overview ¶
Package stripe provides the binding for Stripe REST APIs.
Index ¶
- Constants
- Variables
- func NewIdempotencyKey() string
- func SetBackend(backend SupportedBackend, b Backend)
- func SetHTTPClient(client *http.Client)
- type Account
- type AccountListParams
- type AccountParams
- type Address
- type Amount
- type Backend
- type BackendConfiguration
- func (s BackendConfiguration) Call(method, path, key string, form *url.Values, params *Params, v interface{}) error
- func (s BackendConfiguration) CallMultipart(method, path, key, boundary string, body io.Reader, params *Params, ...) error
- func (s *BackendConfiguration) Do(req *http.Request, v interface{}) error
- func (s *BackendConfiguration) NewRequest(method, path, key, contentType string, body io.Reader, params *Params) (*http.Request, error)
- type Backends
- type Balance
- type BalanceParams
- type BankAccount
- type BankAccountList
- type BankAccountListParams
- type BankAccountParams
- type BankAccountStatus
- type BitcoinReceiver
- type BitcoinReceiverListParams
- type BitcoinReceiverParams
- type BitcoinReceiverUpdateParams
- type BitcoinTransaction
- type BitcoinTransactionList
- type BitcoinTransactionListParams
- type CaptureParams
- type Card
- type CardBrand
- type CardFunding
- type CardList
- type CardListParams
- type CardParams
- type Charge
- type ChargeListParams
- type ChargeParams
- type Coupon
- type CouponDuration
- type CouponListParams
- type CouponParams
- type Currency
- type Customer
- type CustomerListParams
- type CustomerParams
- type CustomerSourceParams
- type DOB
- type Discount
- type Displayer
- type Dispute
- type DisputeEvidence
- type DisputeEvidenceParams
- type DisputeParams
- type DisputeReason
- type DisputeStatus
- type Error
- type ErrorCode
- type ErrorType
- type Event
- type EventData
- type EventListParams
- type EvidenceDetails
- type Fee
- type FeeListParams
- type FeeParams
- type FeeRefund
- type FeeRefundList
- type FeeRefundListParams
- type FeeRefundParams
- type File
- type FileUpload
- type FileUploadListParams
- type FileUploadParams
- type FileUploadPurpose
- type Filters
- type FraudDetails
- type FraudReport
- type IdentityDocument
- type IdentityVerification
- type IdentityVerificationStatus
- type Interval
- type Invoice
- type InvoiceItem
- type InvoiceItemListParams
- type InvoiceItemParams
- type InvoiceLine
- type InvoiceLineList
- type InvoiceLineListParams
- type InvoiceLineType
- type InvoiceListParams
- type InvoiceParams
- type Iter
- type LegalEntity
- type LegalEntityType
- type ListMeta
- type ListParams
- type Owner
- type Params
- type PaymentSource
- type PaymentSourceType
- type Period
- type Plan
- type PlanInterval
- type PlanListParams
- type PlanParams
- type Query
- type Recipient
- type RecipientListParams
- type RecipientParams
- type RecipientType
- type Refund
- type RefundList
- type RefundListParams
- type RefundParams
- type RefundReason
- type Reversal
- type ReversalList
- type ReversalListParams
- type ReversalParams
- type ShippingDetails
- type SourceList
- type SourceListParams
- type SourceParams
- type Sub
- type SubList
- type SubListParams
- type SubParams
- type SubStatus
- type SupportedBackend
- type TOSAcceptanceParams
- type Token
- type TokenParams
- type TokenType
- type Transaction
- type TransactionStatus
- type TransactionType
- type Transfer
- type TransferFailCode
- type TransferListParams
- type TransferParams
- type TransferSchedule
- type TransferScheduleParams
- type TransferStatus
- type TransferType
- type TxFee
- type TxListParams
- type TxParams
- type Verification
Examples ¶
Constants ¶
const ( Individual LegalEntityType = "individual" Company LegalEntityType = "company" IdentityVerificationPending IdentityVerificationStatus = "pending" IdentityVerificationVerified IdentityVerificationStatus = "verified" IdentityVerificationUnverified IdentityVerificationStatus = "unverified" Manual Interval = "manual" Day Interval = "daily" Week Interval = "weekly" Month Interval = "monthly" )
const ( InvalidRequest ErrorType = "invalid_request_error" APIErr ErrorType = "api_error" CardErr ErrorType = "card_error" IncorrectNum ErrorCode = "incorrect_number" InvalidNum ErrorCode = "invalid_number" InvalidExpM ErrorCode = "invalid_expiry_month" InvalidExpY ErrorCode = "invalid_expiry_year" InvalidCvc ErrorCode = "invalid_cvc" ExpiredCard ErrorCode = "expired_card" IncorrectCvc ErrorCode = "incorrect_cvc" IncorrectZip ErrorCode = "incorrect_zip" CardDeclined ErrorCode = "card_declined" Missing ErrorCode = "missing" ProcessingErr ErrorCode = "processing_error" RateLimit ErrorCode = "rate_limit" )
const TotalBackends = 2
Totalbackends is the total number of Stripe API endpoints supported by the binding.
Variables ¶
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
Functions ¶
func NewIdempotencyKey ¶
func NewIdempotencyKey() string
NewIdempotencyKey generates a new idempotency key that can be used on a request.
func SetBackend ¶
func SetBackend(backend SupportedBackend, b Backend)
SetBackend sets the backend used in the binding.
func SetHTTPClient ¶
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.
Types ¶
type Account ¶
type Account struct { ID string `json:"id"` ChargesEnabled bool `json:"charges_enabled"` Country string `json:"country"` // Currencies is the list of supported currencies. Currencies []string `json:"currencies_supported"` DefaultCurrency string `json:"default_currency"` DetailsSubmitted bool `json:"details_submitted"` TransfersEnabled bool `json:"transfers_enabled"` Name string `json:"display_name"` Email string `json:"email"` Statement string `json:"statement_descriptor"` Timezone string `json:"timezone"` BusinessName string `json:"business_name"` BusinessPrimaryColor string `json:"business_primary_color"` BusinessUrl string `json:"business_url"` SupportPhone string `json:"support_phone"` SupportEmail string `json:"support_email"` SupportUrl string `json:"support_url"` ProductDesc string `json:"product_description"` Managed bool `json:"managed"` DebitNegativeBal bool `json:"debit_negative_balances"` Keys *struct { Secret string `json:"secret"` Publish string `json:"publishable"` } `json:"keys"` Verification *struct { Fields []string `json:"fields_needed"` Due *int64 `json:"due_by"` Contacted bool `json:"contacted"` } `json:"verification"` LegalEntity *LegalEntity `json:"legal_entity"` TransferSchedule *TransferSchedule `json:"transfer_schedule"` BankAccounts *BankAccountList `json:"bank_accounts"` TOSAcceptance *struct { Date int64 `json:"date"` IP string `json:"ip"` UserAgent string `json:"user_agent"` } `json:"tos_acceptance"` }
Account is the resource representing your Stripe account. For more details see https://stripe.com/docs/api/#account.
func (*Account) UnmarshalJSON ¶
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 AccountListParams ¶
type AccountListParams struct {
ListParams
}
AccountListParams are the parameters allowed during account listing.
type AccountParams ¶
type AccountParams struct { Params Country, Email, DefaultCurrency, Statement, BusinessName, BusinessUrl, BusinessPrimaryColor, SupportPhone, SupportEmail, SupportUrl string LegalEntity *LegalEntity TransferSchedule *TransferScheduleParams Managed bool BankAccount *BankAccountParams TOSAcceptance *TOSAcceptanceParams }
AccountParams are the parameters allowed during account creation/updates.
type Address ¶
type Address struct { Line1 string `json:"line1"` Line2 string `json:"line2"` City string `json:"city"` State string `json:"state"` Zip string `json:"postal_code"` Country string `json:"country"` }
Address is the structure for an account address.
type Backend ¶
type Backend interface { Call(method, path, key string, body *url.Values, params *Params, v interface{}) error CallMultipart(method, path, key, boundary string, body io.Reader, params *Params, v interface{}) error }
Backend is an interface for making calls against a Stripe service. This interface exists to enable mocking for during testing if needed.
func GetBackend ¶
func GetBackend(backend SupportedBackend) Backend
GetBackend returns the currently used backend in the binding.
type BackendConfiguration ¶
type BackendConfiguration struct { Type SupportedBackend URL string HTTPClient *http.Client }
BackendConfiguration is the internal implementation for making HTTP calls to Stripe.
func (BackendConfiguration) Call ¶
func (s BackendConfiguration) Call(method, path, key string, form *url.Values, params *Params, v interface{}) error
Call is the Backend.Call implementation for invoking Stripe APIs.
func (BackendConfiguration) CallMultipart ¶
func (s BackendConfiguration) CallMultipart(method, path, key, boundary string, body io.Reader, params *Params, v interface{}) error
CallMultipart is the Backend.CallMultipart implementation for invoking Stripe APIs.
func (*BackendConfiguration) Do ¶
func (s *BackendConfiguration) Do(req *http.Request, 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 (*BackendConfiguration) NewRequest ¶
func (s *BackendConfiguration) NewRequest(method, path, key, contentType string, body io.Reader, params *Params) (*http.Request, error)
NewRequest is used by Call to generate an http.Request. It handles encoding parameters and attaching the appropriate headers.
type Backends ¶
type Backends struct {
API, Uploads Backend
}
Backends are the currently supported endpoints.
type Balance ¶
type Balance struct { // Live indicates the live mode. Live bool `json:"livemode"` Available []Amount `json:"available"` Pending []Amount `json:"pending"` }
Balance is the resource representing your Stripe balance. For more details see https://stripe.com/docs/api/#balance.
type BalanceParams ¶
type BalanceParams struct {
Params
}
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 BankAccount ¶
type BankAccount struct { ID string `json:"id"` Name string `json:"bank_name"` Country string `json:"country"` Currency Currency `json:"currency"` LastFour string `json:"last4"` Fingerprint string `json:"fingerprint"` Status BankAccountStatus `json:"status"` Routing string `json:"routing_number"` }
BankAccount represents a Stripe bank account.
func (*BankAccount) UnmarshalJSON ¶
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 BankAccountList ¶
type BankAccountList struct { ListMeta Values []*BankAccount `json:"data"` }
BankAccountList is a list object for bank accounts.
type BankAccountListParams ¶
type BankAccountListParams struct { ListParams AccountID string }
BankAccountListParams is the set of parameters that can be used when listing bank accounts.
type BankAccountParams ¶
type BankAccountParams struct { Params AccountID, Token, Country, Routing, Account, Currency string Default bool }
BankAccountParams is the set of parameters that can be used when creating or updating a bank account.
func (*BankAccountParams) AppendDetails ¶
func (b *BankAccountParams) AppendDetails(values *url.Values)
AppendDetails adds the bank account's details to the query string values.
type BankAccountStatus ¶
type BankAccountStatus string
BankAccountStatus is the list of allowed values for the bank account's status. Allowed values are "new", "verified", "validated", "errored".
type BitcoinReceiver ¶
type BitcoinReceiver struct { ID string `json:"id"` Created int64 `json:"created"` Currency Currency `json:"currency"` Amount uint64 `json:"amount"` AmountReceived uint64 `json:"amount_received"` BitcoinAmount uint64 `json:"bitcoin_amount"` BitcoinAmountReceived uint64 `json:"bitcoin_amount_received"` Filled bool `json:"filled"` Active bool `json:"active"` RejectTransactions bool `json:"reject_transactions"` Desc string `json:"description"` InboundAddress string `json:"inbound_address"` RefundAddress string `json:"refund_address"` BitcoinUri string `json:"bitcoin_uri"` Meta map[string]string `json:"metadata"` Email string `json:"email"` Payment string `json:"payment"` Customer string `json:"customer"` 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) Display ¶
func (br *BitcoinReceiver) Display() string
Display human readable representation of a BitcoinReceiver.
func (*BitcoinReceiver) UnmarshalJSON ¶
func (br *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 BitcoinReceiverListParams ¶
type BitcoinReceiverListParams struct { ListParams NotFilled, NotActive, Uncaptured bool }
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 BitcoinReceiverParams ¶
BitcoinReceiverParams is the set of parameters that can be used when creating a BitcoinReceiver. For more details see https://stripe.com/docs/api/#create_bitcoin_receiver.
type BitcoinReceiverUpdateParams ¶
BitcoinReceiverParams is the set of parameters that can be used when updating a BitcoinReceiver. For more details see https://stripe.com/docs/api/#update_bitcoin_receiver.
type BitcoinTransaction ¶
type BitcoinTransaction struct { ID string `json:"id"` Created int64 `json:"created"` Amount uint64 `json:"amount"` Currency Currency `json:"currency"` BitcoinAmount uint64 `json:"bitcoin_amount"` Receiver string `json:"receiver"` Customer string `json:"customer"` }
BitcoinTransaction is the resource representing a Stripe bitcoin transaction. For more details see https://stripe.com/docs/api/#bitcoin_receivers
func (*BitcoinTransaction) UnmarshalJSON ¶
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 ¶
type BitcoinTransactionList struct { ListMeta Values []*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 ¶
type BitcoinTransactionListParams struct { ListParams Receiver, Customer string }
BitcoinTransactionListParams is the set of parameters that can be used when listing BitcoinTransactions.
type CaptureParams ¶
CaptureParams is the set of parameters that can be used when capturing a charge. For more details see https://stripe.com/docs/api#charge_capture.
type Card ¶
type Card struct { ID string `json:"id"` Month uint8 `json:"exp_month"` Year uint16 `json:"exp_year"` Fingerprint string `json:"fingerprint"` Funding CardFunding `json:"funding"` LastFour string `json:"last4"` Brand CardBrand `json:"brand"` City string `json:"address_city"` Country string `json:"address_country"` Address1 string `json:"address_line1"` Address1Check Verification `json:"address_line1_check"` Address2 string `json:"address_line2"` State string `json:"address_state"` Zip string `json:"address_zip"` ZipCheck Verification `json:"address_zip_check"` CardCountry string `json:"country"` Customer *Customer `json:"customer"` CVCCheck Verification `json:"cvc_check"` Name string `json:"name"` Recipient *Recipient `json:"recipient"` DynLastFour string `json:"dynamic_last4"` }
Card is the resource representing a Stripe credit/debit card. For more details see https://stripe.com/docs/api#cards.
func (*Card) UnmarshalJSON ¶
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 CardBrand ¶
type CardBrand string
CardBrand is the list of allowed values for the card's brand. Allowed values are "Unknown", "Visa", "American Express", "MasterCard", "Discover" "JCB", "Diners Club".
type CardFunding ¶
type CardFunding string
CardFunding is the list of allowed values for the card's funding. Allowed values are "credit", "debit", "prepaid", "unknown".
type CardListParams ¶
type CardListParams struct { ListParams Customer, Recipient string }
CardListParams is the set of parameters that can be used when listing cards. For more details see https://stripe.com/docs/api#list_cards.
type CardParams ¶
type CardParams struct { Params Token string Customer, Recipient string Name, Number, Month, Year, CVC string Address1, Address2, City, State, Zip, Country string }
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.
func (*CardParams) AppendDetails ¶
func (c *CardParams) AppendDetails(values *url.Values, creating bool)
AppendDetails adds the card's details to the query string values. When creating a new card, the parameters are passed as a dictionary, but on updates they are simply the parameter name.
type Charge ¶
type Charge struct { ID string `json:"id"` Live bool `json:"livemode"` Amount uint64 `json:"amount"` Captured bool `json:"captured"` Created int64 `json:"created"` Currency Currency `json:"currency"` Paid bool `json:"paid"` Refunded bool `json:"refunded"` Refunds *RefundList `json:"refunds"` AmountRefunded uint64 `json:"amount_refunded"` Tx *Transaction `json:"balance_transaction"` Customer *Customer `json:"customer"` Desc string `json:"description"` Dispute *Dispute `json:"dispute"` FailMsg string `json:"failure_message"` FailCode string `json:"failure_code"` Invoice *Invoice `json:"invoice"` Meta map[string]string `json:"metadata"` Email string `json:"receipt_email"` Statement string `json:"statement_descriptor"` FraudDetails *FraudDetails `json:"fraud_details"` Status string `json:"status"` Source *PaymentSource `json:"source"` Shipping *ShippingDetails `json:"shipping"` }
Charge is the resource representing a Stripe charge. For more details see https://stripe.com/docs/api#charges.
Example (Get) ¶
package main import ( "log" stripe "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/charge" ) func main() { stripe.Key = "sk_key" params := &stripe.ChargeParams{} params.Expand("customer") params.Expand("balance_transaction") ch, err := charge.Get("ch_example_id", params) if err != nil { log.Fatal(err) } log.Printf("%v\n", ch.ID) }
Output:
Example (New) ¶
package main import ( "log" stripe "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/charge" "github.com/stripe/stripe-go/currency" ) func main() { stripe.Key = "sk_key" params := &stripe.ChargeParams{ Amount: 1000, Currency: currency.USD, } params.SetSource(&stripe.CardParams{ Name: "Go Stripe", Number: "4242424242424242", Month: "10", Year: "20", }) params.AddMeta("key", "value") ch, err := charge.New(params) if err != nil { log.Fatal(err) } log.Printf("%v\n", ch.ID) }
Output:
func (*Charge) UnmarshalJSON ¶
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 ChargeListParams ¶
type ChargeListParams struct { ListParams Created int64 Customer string }
ChargeListParams is the set of parameters that can be used when listing charges. For more details see https://stripe.com/docs/api#list_charges.
type ChargeParams ¶
type ChargeParams struct { Params Amount uint64 Currency Currency Customer, Token string Desc, Statement, Email, Dest string NoCapture bool Fee uint64 Fraud FraudReport Source *SourceParams Shipping *ShippingDetails }
ChargeParams is the set of parameters that can be used when creating or updating a charge. For more details see https://stripe.com/docs/api#create_charge and https://stripe.com/docs/api#update_charge.
func (*ChargeParams) SetSource ¶
func (cp *ChargeParams) SetSource(sp interface{}) error
SetSource adds valid sources to a ChargeParams object, returning an error for unsupported sources.
type Coupon ¶
type Coupon struct { ID string `json:"id"` Live bool `json:"livemode"` Created int64 `json:"created"` Duration CouponDuration `json:"duration"` Amount uint64 `json:"amount_off"` Currency Currency `json:"currency"` DurationPeriod uint64 `json:"duration_in_months"` Redemptions uint64 `json:"max_redemptions"` Meta map[string]string `json:"metadata"` Percent uint64 `json:"percent_off"` RedeemBy int64 `json:"redeem_by"` Redeemed uint64 `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 ¶
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 ¶
type CouponDuration string
CouponDuration is the list of allowed values for the coupon's duration. Allowed values are "forever", "once", "repeating".
type CouponListParams ¶
type CouponListParams struct {
ListParams
}
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 ¶
type CouponParams struct { Params Duration CouponDuration ID string Currency Currency Amount, Percent, DurationPeriod, Redemptions uint64 RedeemBy int64 }
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 Currency ¶
type Currency string
Currency is the list of supported currencies. For more details see https://support.stripe.com/questions/which-currencies-does-stripe-support.
type Customer ¶
type Customer struct { ID string `json:"id"` Live bool `json:"livemode"` Sources *SourceList `json:"sources"` Created int64 `json:"created"` Balance int64 `json:"account_balance"` Currency Currency `json:"currency"` DefaultSource *PaymentSource `json:"default_source"` Delinquent bool `json:"delinquent"` Desc string `json:"description"` Discount *Discount `json:"discount"` Email string `json:"email"` Meta map[string]string `json:"metadata"` Subs *SubList `json:"subscriptions"` Deleted bool `json:"deleted"` }
Customer is the resource representing a Stripe customer. For more details see https://stripe.com/docs/api#customers.
Example (Delete) ¶
package main import ( "log" stripe "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/customer" ) func main() { stripe.Key = "sk_key" err := customer.Del("acct_example_id") if err != nil { log.Fatal(err) } }
Output:
func (*Customer) UnmarshalJSON ¶
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 CustomerListParams ¶
type CustomerListParams struct { ListParams Created int64 }
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 ¶
type CustomerParams struct { Params Balance int64 Token, Coupon string Source *SourceParams Desc, Email string Plan string Quantity uint64 TrialEnd int64 DefaultSource string }
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 ¶
func (cp *CustomerParams) SetSource(sp interface{}) error
SetSource adds valid sources to a CustomerParams object, returning an error for unsupported sources.
type CustomerSourceParams ¶
type CustomerSourceParams struct { Params Customer string Source *SourceParams }
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 ¶
func (cp *CustomerSourceParams) SetSource(sp interface{}) error
SetSource adds valid sources to a CustomerSourceParams object, returning an error for unsupported sources.
type Discount ¶
type Discount struct { Coupon *Coupon `json:"coupon"` Customer string `json:"customer"` Start int64 `json:"start"` End int64 `json:"end"` Sub string `json:"subscription"` }
Discount is the resource representing a Stripe discount. For more details see https://stripe.com/docs/api#discounts.
type Displayer ¶
type Displayer interface {
Display() string
}
Displayer provides a human readable representation of a struct
type Dispute ¶
type Dispute struct { Live bool `json:"livemode"` Amount uint64 `json:"amount"` Currency Currency `json:"currency"` Charge string `json:"charge"` Created int64 `json:"created"` Refundable bool `json:"is_charge_refundable"` Reason DisputeReason `json:"reason"` Status DisputeStatus `json:"status"` Transactions []*Transaction `json:"balance_transactions"` Evidence *DisputeEvidence `json:"evidence"` EvidenceDetails *EvidenceDetails `json:"evidence_details"` Meta map[string]string `json:"metadata"` }
Dispute is the resource representing a Stripe dispute. For more details see https://stripe.com/docs/api#disputes.
type DisputeEvidence ¶
type DisputeEvidence struct { ProductDesc string `json:"product_description"` CustomerName string `json:"customer_name"` CustomerEmail string `json:"customer_email_address"` CustomerIP string `json:"customer_purchase_ip"` CustomerSig *File `json:"customer_signature"` BillingAddress string `json:"billing_address"` Receipt *File `json:"receipt"` ShippingAddress string `json:"shipping_address"` ShippingDate string `json:"shipping_date"` ShippingTracking string `json:"shipping_tracking_number"` ShippingDoc *File `json:"shipping_documentation"` RefundPolicy *File `json:"refund_policy"` RefundPolicyDisclosure string `json:"refund_policy_disclosure"` RefundRefusalReason string `json:"refund_refusal_explanation"` CancellationPolicy *File `json:"cancellation_policy"` CancellationPolicyDisclosure string `json:"cancellation_policy_disclosure"` CancellationRebuttal string `json:"cancellation_rebuttal"` ActivityLog string `json:"access_activity_log"` ServiceDate string `json:"service_date"` ServiceDoc *File `json:"service_documentation"` DuplicateCharge string `json:"duplicate_charge_id"` DuplicateChargeReason string `json:"duplicate_charge_explanation"` DuplicateChargeDoc *File `json:"duplicate_charge_documentation"` CustomerComm *File `json:"customer_communication"` UncategorizedText string `json:"uncategorized_text"` UncategorizedFile *File `json:"uncategorized_file"` }
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 ¶
type DisputeEvidenceParams struct {
ProductDesc, CustomerName, CustomerEmail, CustomerIP, CustomerSig, BillingAddress, Receipt string
ShippingAddress, ShippingDate, ShippingTracking, ShippingDoc string
RefundPolicy, RefundPolicyDisclosure, RefundRefusalReason string
CancellationPolicy, CancellationPolicyDisclsoure, CancellationRebuttal string
ActivityLog string
ServiceDate, ServiceDoc string
DuplicateCharge, DuplicateChargeReason, DuplicateChargeDoc string
CustomerComm, UncategorizedText, UncategorizedFile string
}
DisputeEvidenceParams is the set of parameters that can be used when submitting evidence for disputes.
func (*DisputeEvidenceParams) AppendDetails ¶
func (e *DisputeEvidenceParams) AppendDetails(values *url.Values)
AppendDetails adds the dispute evidence details to the query string values.
type DisputeParams ¶
type DisputeParams struct { Params Evidence *DisputeEvidenceParams }
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 ¶
type DisputeReason string
DisputeReason is the list of allowed values for a discount's reason. Allowed values are "duplicate", "fraudulent", "subscription_canceled", "product_unacceptable", "product_not_received", "unrecognized", "credit_not_processed", "general".
type DisputeStatus ¶
type DisputeStatus string
DisputeStatus is the list of allowed values for a discount's status. Allowed values are "won", "lost", "needs_ressponse", "under_review", "warning_needs_response", "warning_under_review", "charge_refunded", "warning_closed".
type Error ¶
type Error struct { Type ErrorType `json:"type"` Msg string `json:"message"` Code ErrorCode `json:"code,omitempty"` Param string `json:"param,omitempty"` HTTPStatusCode int `json:"-"` }
Error is the response returned when a call is unsuccessful. For more details see https://stripe.com/docs/api#errors.
type ErrorCode ¶
type ErrorCode string
ErrorCode is the list of allowed values for the error's code. Allowed values are "incorrect_number", "invalid_number", "invalid_expiry_month", "invalid_expiry_year", "invalid_cvc", "expired_card", "incorrect_cvc", "incorrect_zip", "card_declined", "missing", "processing_error", "rate_limit".
type ErrorType ¶
type ErrorType string
ErrorType is the list of allowed values for the error's type. Allowed values are "invalid_request_error", "api_error", "card_error".
type Event ¶
type Event struct { ID string `json:"id"` Live bool `json:"livemode"` Created int64 `json:"created"` Data *EventData `json:"data"` Webhooks uint64 `json:"pending_webhooks"` Type string `json:"type"` Req string `json:"request"` UserID string `json:"user_id"` }
Event is the resource representing a Stripe event. For more details see https://stripe.com/docs/api#events.
func (*Event) GetObjValue ¶
GetObjValue returns the value from the e.Data.Obj bag based on the keys hierarchy.
func (*Event) GetPrevValue ¶
GetPrevValue returns the value from the e.Data.Prev bag based on the keys hierarchy.
type EventData ¶
type EventData struct { Raw json.RawMessage `json:"object"` Prev map[string]interface{} `json:"previous_attributes"` Obj map[string]interface{} }
EventData is the unmarshalled object as a map.
func (*EventData) UnmarshalJSON ¶
UnmarshalJSON handles deserialization of the EventData. This custom unmarshaling exists so that we can keep both the map and raw data.
type EventListParams ¶
type EventListParams struct { ListParams Created int64 // Type is one of the values documented at https://stripe.com/docs/api#event_types. Type string }
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 EvidenceDetails ¶
EvidenceDetails is the structure representing more details about the dispute.
type Fee ¶
type Fee struct { ID string `json:"id"` Live bool `json:"livemode"` Account *Account `json:"account"` Amount uint64 `json:"amount"` App string `json:"application"` Tx *Transaction `json:"balance_transaction"` Charge *Charge `json:"charge"` Created int64 `json:"created"` Currency Currency `json:"currency"` Refunded bool `json:"refunded"` Refunds *FeeRefundList `json:"refunds"` AmountRefunded uint64 `json:"amount_refunded"` }
Fee is the resource representing a Stripe application fee. For more details see https://stripe.com/docs/api#application_fees.
func (*Fee) UnmarshalJSON ¶
UnmarshalJSON handles deserialization of a Fee. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type FeeListParams ¶
type FeeListParams struct { ListParams Created int64 Charge string }
FeeListParams 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 FeeParams ¶
FeeParams 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 FeeRefund ¶
type FeeRefund struct { ID string `json:"id"` Amount uint64 `json:"amount"` Created int64 `json:"created"` Currency Currency `json:"currency"` Tx *Transaction `json:"balance_transaction"` Fee string `json:"fee"` Meta map[string]string `json:"metadata"` }
FeeRefund is the resource representing a Stripe fee refund. For more details see https://stripe.com/docs/api#fee_refunds.
func (*FeeRefund) UnmarshalJSON ¶
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 ¶
FeeRefundList is a list object for fee refunds.
type FeeRefundListParams ¶
type FeeRefundListParams struct { ListParams Fee string }
FeeRefundListParams is the set of parameters that can be used when listing fee refunds. For more details see https://stripe.com/docs/api#list_fee_refunds.
type FeeRefundParams ¶
FeeRefundParams is the set of parameters that can be used when refunding a fee. For more details see https://stripe.com/docs/api#fee_refund.
type File ¶
type File struct { ID string `json:"id"` Created int64 `json:"created"` Size int `json:"size"` Purpose string `json:"purpose"` URL string `json:"url"` Mime string `json:"mime_type"` }
File represents a link to downloadable content.
func (*File) UnmarshalJSON ¶
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 FileUpload ¶
type FileUpload struct { ID string `json:"id"` Created int64 `json:"created"` Size int64 `json:"size"` Purpose FileUploadPurpose `json:"purpose"` URL string `json:"url"` Type string `json:"type"` }
FileUpload is the resource representing a Stripe file upload. For more details see https://stripe.com/docs/api#file_uploads.
func (*FileUpload) UnmarshalJSON ¶
func (f *FileUpload) UnmarshalJSON(data []byte) error
UnmarshalJSON handles deserialization of a FileUpload. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type FileUploadListParams ¶
type FileUploadListParams struct { Purpose FileUploadPurpose ListParams }
FileUploadListParams is the set of parameters that can be used when listing file uploads. For more details see https://stripe.com/docs/api#list_file_uploads.
type FileUploadParams ¶
type FileUploadParams struct { Params Purpose FileUploadPurpose File *os.File }
FileUploadParams is the set of parameters that can be used when creating a file upload. For more details see https://stripe.com/docs/api#create_file_upload.
func (*FileUploadParams) AppendDetails ¶
func (f *FileUploadParams) AppendDetails(body io.ReadWriter) (string, error)
AppendDetails adds the file upload details to an io.ReadWriter. It returns the boundary string for a multipart/form-data request and an error (if one exists).
type FileUploadPurpose ¶
type FileUploadPurpose string
FileUploadPurpose is the purpose of a particular file upload. Allowed values are "dispute_evidence" and "identity_document".
type Filters ¶
type Filters struct {
// contains filtered or unexported fields
}
Filters is a structure that contains a collection of filters for list-related APIs.
type FraudDetails ¶
type FraudDetails struct { UserReport FraudReport `json:"user_report"` StripeReport FraudReport `json:"stripe_report"` }
FraudDetails is the structure detailing fraud status.
type FraudReport ¶
type FraudReport string
FraudReport is the list of allowed values for reporting fraud. Allowed values are "fraudulent", "safe".
type IdentityDocument ¶
type IdentityDocument struct { ID string `json:"id"` Created int64 `json:"created"` Size int64 `json:"size"` }
IdentityDocument is the structure for an identity document.
func (*IdentityDocument) UnmarshalJSON ¶
func (d *IdentityDocument) UnmarshalJSON(data []byte) error
UnmarshalJSON handles deserialization of an IdentityDocument. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type IdentityVerification ¶
type IdentityVerification struct { Status IdentityVerificationStatus `json:"status"` Document *IdentityDocument `json:"document"` Details *string `json:"details"` }
IdentityVerification is the structure for an account's verification.
type IdentityVerificationStatus ¶
type IdentityVerificationStatus string
IdentityVerificationStatus describes the different statuses for identity verification. Current values are "pending", "verified", "unverified".
type Interval ¶
type Interval string
Interval describes the payout interval. Current values are "manual", "daily", "weekly", "monthly".
type Invoice ¶
type Invoice struct { ID string `json:"id"` Live bool `json:"livemode"` Amount int64 `json:"amount_due"` Attempts uint64 `json:"attempt_count"` Attempted bool `json:"attempted"` Closed bool `json:"closed"` Currency Currency `json:"currency"` Customer *Customer `json:"customer"` Date int64 `json:"date"` Forgive bool `json:"forgiven"` Lines *InvoiceLineList `json:"lines"` Paid bool `json:"paid"` End int64 `json:"period_end"` Start int64 `json:"period_start"` StartBalance int64 `json:"starting_balance"` Subtotal int64 `json:"subtotal"` Total int64 `json:"total"` Tax int64 `json:"tax"` TaxPercent float64 `json:"tax_percent"` Fee uint64 `json:"application_fee"` Charge *Charge `json:"charge"` Desc string `json:"description"` Discount *Discount `json:"discount"` EndBalance int64 `json:"ending_balance"` NextAttempt int64 `json:"next_payment_attempt"` Statement string `json:"statement_descriptor"` Sub string `json:"subscription"` Webhook int64 `json:"webhooks_delivered_at"` Meta map[string]string `json:"metadata"` }
Invoice is the resource representing a Stripe invoice. For more details see https://stripe.com/docs/api#invoice_object.
Example (Update) ¶
package main import ( "log" stripe "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/invoice" ) func main() { stripe.Key = "sk_key" params := &stripe.InvoiceParams{ Desc: "updated description", } inv, err := invoice.Update("sub_example_id", params) if err != nil { log.Fatal(err) } log.Printf("%v\n", inv.Desc) }
Output:
func (*Invoice) UnmarshalJSON ¶
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 InvoiceItem ¶
type InvoiceItem struct { ID string `json:"id"` Live bool `json:"livemode"` Amount int64 `json:"amount"` Currency Currency `json:"currency"` Customer *Customer `json:"customer"` Date int64 `json:"date"` Proration bool `json:"proration"` Desc string `json:"description"` Invoice *Invoice `json:"invoice"` Meta map[string]string `json:"metadata"` Sub string `json:"subscription"` Discountable bool `json:"discountable"` }
InvoiceItem is the resource represneting a Stripe invoice item. For more details see https://stripe.com/docs/api#invoiceitems.
func (*InvoiceItem) UnmarshalJSON ¶
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 InvoiceItemListParams ¶
type InvoiceItemListParams struct { ListParams Created int64 Customer string }
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 ¶
type InvoiceItemParams struct { Params Customer string Amount int64 Currency Currency Invoice, Desc, Sub string Discountable bool }
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 InvoiceLine ¶
type InvoiceLine struct { ID string `json:"id"` Live bool `json:"live_mode"` Amount int64 `json:"amount"` Currency Currency `json:"currency"` Period *Period `json:"period"` Proration bool `json:"proration"` Type InvoiceLineType `json:"type"` Desc string `json:"description"` Meta map[string]string `json:"metadata"` Plan *Plan `json:"plan"` Quantity int64 `json:"quantity"` }
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 ¶
type InvoiceLineList struct { ListMeta Values []*InvoiceLine `json:"data"` }
InvoiceLineList is a list object for invoice line items.
type InvoiceLineListParams ¶
type InvoiceLineListParams struct { ListParams ID string Customer, Sub string }
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 ¶
type InvoiceLineType string
InvoiceLineType is the list of allowed values for the invoice line's type. Allowed values are "invoiceitem", "subscription".
type InvoiceListParams ¶
type InvoiceListParams struct { ListParams Date int64 Customer string }
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 InvoiceParams ¶
type InvoiceParams struct { Params Customer string Desc, Statement, Sub string Fee uint64 Closed, Forgive bool TaxPercent float64 }
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.
type Iter ¶
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 ¶
func GetIter(params *ListParams, qs *url.Values, query Query) *Iter
GetIter returns a new Iter for a given query and its options.
func (*Iter) Current ¶
func (it *Iter) Current() interface{}
Current returns the most recent item visited by a call to Next.
type LegalEntity ¶
type LegalEntity struct { Type LegalEntityType `json:"type"` BusinessName string `json:"business_name"` Address Address `json:"address"` First string `json:"first_name"` Last string `json:"last_name"` PersonalAddress Address `json:"personal_address"` DOB DOB `json:"dob"` AdditionalOwners []Owner `json:"additional_owners"` Verification IdentityVerification `json:"verification"` SSN string `json:"ssn_last_4"` PersonalID string `json:"personal_id_number"` BusinessTaxID string `json:"business_tax_id"` BusinessVatID string `json:"business_vat_id"` }
LegalEntity is the structure for properties related to an account's legal state.
func (*LegalEntity) AppendDetails ¶
func (l *LegalEntity) AppendDetails(values *url.Values)
AppendDetails adds the legal entity to the query string.
type LegalEntityType ¶
type LegalEntityType string
LegalEntityType describes the types for a legal entity. Current values are "individual", "company".
type ListMeta ¶
type ListMeta struct { Count uint16 `json:"total_count"` More bool `json:"has_more"` 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 ¶
type ListParams struct {
Start, End string
Limit int
Filters Filters
// 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
}
ListParams is the structure that contains the common properties of any *ListParams structure.
func (*ListParams) AppendTo ¶
func (p *ListParams) AppendTo(body *url.Values)
AppendTo adds the common parameters to the query string values.
type Owner ¶
type Owner struct { First string `json:"first_name"` Last string `json:"last_name"` DOB DOB `json:"dob"` Address Address `json:"address"` Verification IdentityVerification `json:"verification"` }
Owner is the structure for an account owner.
type Params ¶
type Params struct { Exp []string Meta map[string]string Extra url.Values IdempotencyKey, Account string }
Params is the structure that contains the common properties of any *Params structure.
func (*Params) SetAccount ¶
SetAccount sets a value for the Stripe-Account header.
type PaymentSource ¶
type PaymentSource struct { Type PaymentSourceType `json:"object"` ID string `json:"id"` Card *Card `json:"-"` BitcoinReceiver *BitcoinReceiver `json:"-"` }
PaymentSource describes the payment source used to make a Charge. The Type should indicate which object is fleshed out (eg. BitcoinReceiver or Card) For more details see https://stripe.com/docs/api#retrieve_charge
func (*PaymentSource) Display ¶
func (s *PaymentSource) Display() string
Display human readable representation of source.
func (*PaymentSource) MarshalJSON ¶
func (s *PaymentSource) MarshalJSON() ([]byte, error)
MarshalJSON handles serialization of a PaymentSource. This custom marshaling is needed because the specific type of payment instrument it represents is specified by the PaymentSourceType
func (*PaymentSource) UnmarshalJSON ¶
func (s *PaymentSource) UnmarshalJSON(data []byte) error
UnmarshalJSON handles deserialization of a PaymentSource. This custom unmarshaling is needed because the specific type of payment instrument it refers to is specified in the JSON
type PaymentSourceType ¶
type PaymentSourceType string
PaymentSourceType consts represent valid payment sources
const ( PaymentSourceBitcoinReceiver PaymentSourceType = "bitcoin_receiver" PaymentSourceCard PaymentSourceType = "card" )
type Plan ¶
type Plan struct { ID string `json:"id"` Live bool `json:"livemode"` Amount uint64 `json:"amount"` Created int64 `json:"created"` Currency Currency `json:"currency"` Interval PlanInterval `json:"interval"` IntervalCount uint64 `json:"interval_count"` Name string `json:"name"` Meta map[string]string `json:"metadata"` TrialPeriod uint64 `json:"trial_period_days"` Statement string `json:"statement_descriptor"` }
Plan is the resource representing a Stripe plan. For more details see https://stripe.com/docs/api#plans.
Example (List) ¶
package main import ( "log" stripe "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/plan" ) func main() { stripe.Key = "sk_key" params := &stripe.PlanListParams{} params.Filters.AddFilter("limit", "", "3") params.Single = true it := plan.List(params) for it.Next() { log.Printf("%v ", it.Plan().Name) } if err := it.Err(); err != nil { log.Fatal(err) } }
Output:
type PlanInterval ¶ added in v1.0.1
type PlanInterval string
PlanInterval is the list of allowed values for a plan's interval. Allowed values are "day", "week", "month", "year".
type PlanListParams ¶
type PlanListParams struct {
ListParams
}
PlanListParams is the set of parameters that can be used when listing plans. For more details see https://stripe.com/docs/api#list_plans.
type PlanParams ¶
type PlanParams struct { Params ID, Name string Currency Currency Amount uint64 Interval PlanInterval IntervalCount, TrialPeriod uint64 Statement string }
PlanParams is the set of parameters that can be used when creating or updating a plan. For more details see https://stripe.com/docs/api#create_plan and https://stripe.com/docs/api#update_plan.
type Recipient ¶
type Recipient struct { ID string `json:"id"` Live bool `json:"livemode"` Created int64 `json:"created"` Type RecipientType `json:"type"` Bank *BankAccount `json:"active_account"` Desc string `json:"description"` Email string `json:"email"` Meta map[string]string `json:"metadata"` Name string `json:"name"` Cards *CardList `json:"cards"` DefaultCard *Card `json:"default_card"` }
Recipient is the resource representing a Stripe recipient. For more details see https://stripe.com/docs/api#recipients.
func (*Recipient) UnmarshalJSON ¶
UnmarshalJSON handles deserialization of a Recipient. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type RecipientListParams ¶
type RecipientListParams struct { ListParams Verified bool }
RecipientListParams is the set of parameters that can be used when listing recipients. For more details see https://stripe.com/docs/api#list_recipients.
type RecipientParams ¶
type RecipientParams struct { Params Name string Type RecipientType TaxID, Token, Email, Desc string Bank *BankAccountParams Card *CardParams DefaultCard string }
RecipientParams is the set of parameters that can be used when creating or updating recipients. For more details see https://stripe.com/docs/api#create_recipient and https://stripe.com/docs/api#update_recipient.
type RecipientType ¶
type RecipientType string
RecipientType is the list of allowed values for the recipient's type. Allowed values are "individual", "corporation".
type Refund ¶
type Refund struct { ID string `json:"id"` Amount uint64 `json:"amount"` Created int64 `json:"created"` Currency Currency `json:"currency"` Tx *Transaction `json:"balance_transaction"` Charge string `json:"charge"` Meta map[string]string `json:"metadata"` Reason RefundReason `json:"reason"` }
Refund is the resource representing a Stripe refund. For more details see https://stripe.com/docs/api#refunds.
func (*Refund) UnmarshalJSON ¶
UnmarshalJSON handles deserialization of a Refund. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type RefundList ¶
RefundList is a list object for refunds.
type RefundListParams ¶
type RefundListParams struct { ListParams Charge string }
RefundListParams is the set of parameters that can be used when listing refunds. For more details see https://stripe.com/docs/api#list_refunds.
type RefundParams ¶
type RefundParams struct { Params Charge string Amount uint64 Fee, Transfer bool Reason RefundReason }
RefundParams is the set of parameters that can be used when refunding a charge. For more details see https://stripe.com/docs/api#refund.
type RefundReason ¶
type RefundReason string
RefundReason, if set, is the reason the refund is being made--allowed values are "fraudulent", "duplicate", and "requested_by_customer".
type Reversal ¶
type Reversal struct { ID string `json:"id"` Amount uint64 `json:"amount"` Created int64 `json:"created"` Currency Currency `json:"currency"` Transfer string `json:"transfer"` Meta map[string]string `json:"metadata"` Tx *Transaction `json:"balance_transaction"` }
Reversal represents a transfer reversal.
func (*Reversal) UnmarshalJSON ¶
UnmarshalJSON handles deserialization of a Reversal. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type ReversalList ¶
ReversalList is a list of object for reversals.
type ReversalListParams ¶
type ReversalListParams struct { ListParams Transfer string }
ReversalListParams is the set of parameters that can be used when listing reversals.
type ReversalParams ¶
ReversalParams is the set of parameters that can be used when reversing a transfer.
type ShippingDetails ¶
type ShippingDetails struct { Name string `json:"name"` Address Address `json:"address"` Phone string `json:"phone"` Tracking string `json:"tracking_number"` Carrier string `json:"carrier"` }
ShippingDetails is the structure containing shipping information.
func (*ShippingDetails) AppendDetails ¶
func (s *ShippingDetails) AppendDetails(values *url.Values)
AppendDetails adds the shipping details to the query string.
type SourceList ¶
type SourceList struct { ListMeta Values []*PaymentSource `json:"data"` }
SourceList is a list object for cards.
type SourceListParams ¶
type SourceListParams struct { ListParams Customer string }
PaymentSourceListParams are used to enumerate the payment sources that are attached to a Customer.
type SourceParams ¶
type SourceParams struct { Token string Card *CardParams }
SourceParams is a union struct used to describe an arbitrary payment source.
func SourceParamsFor ¶
func SourceParamsFor(obj interface{}) (*SourceParams, error)
SourceParamsFor creates SourceParams objects around supported payment sources, returning errors if not.
Currently supported source types are Card (CardParams) and Tokens/IDs (string), where Tokens could be single use card tokens or bitcoin receiver ids
func (*SourceParams) AppendDetails ¶
func (sp *SourceParams) AppendDetails(values *url.Values, creating bool)
AppendDetails adds the source's details to the query string values. For cards: when creating a new one, the parameters are passed as a dictionary, but on updates they are simply the parameter name.
type Sub ¶
type Sub struct { ID string `json:"id"` EndCancel bool `json:"cancel_at_period_end"` Customer *Customer `json:"customer"` Plan *Plan `json:"plan"` Quantity uint64 `json:"quantity"` Status SubStatus `json:"status"` FeePercent float64 `json:"application_fee_percent"` Canceled int64 `json:"canceled_at"` PeriodEnd int64 `json:"current_period_end"` PeriodStart int64 `json:"current_period_start"` Discount *Discount `json:"discount"` Ended int64 `json:"ended_at"` Meta map[string]string `json:"metadata"` TaxPercent float64 `json:"tax_percent"` TrialEnd int64 `json:"trial_end"` TrialStart int64 `json:"trial_start"` }
Sub is the resource representing a Stripe subscription. For more details see https://stripe.com/docs/api#subscriptions.
func (*Sub) UnmarshalJSON ¶
UnmarshalJSON handles deserialization of a Sub. This custom unmarshaling is needed because the resulting property may be an id or the full struct if it was expanded.
type SubListParams ¶
type SubListParams struct { ListParams Customer string }
SubListParams is the set of parameters that can be used when listing active subscriptions. For more details see https://stripe.com/docs/api#list_subscriptions.
type SubParams ¶
type SubParams struct { Params Customer, Plan string Coupon, Token string TrialEnd int64 Card *CardParams Quantity uint64 FeePercent, TaxPercent float64 NoProrate, EndCancel, QuantityZero, TrialEndNow bool }
SubParams is the set of parameters that can be used when creating or updating a subscription. For more details see https://stripe.com/docs/api#create_subscription and https://stripe.com/docs/api#update_subscription.
type SubStatus ¶
type SubStatus string
SubStatus is the list of allowed values for the subscription's status. Allowed values are "trialing", "active", "past_due", "canceled", "unpaid".
type SupportedBackend ¶
type SupportedBackend string
SupportedBackend is an enumeration of supported Stripe endpoints. Currently supported values are "api" and "uploads".
const ( APIBackend SupportedBackend = "api" UploadsBackend SupportedBackend = "uploads" )
type TOSAcceptanceParams ¶
type TOSAcceptanceParams struct { Date int64 `json:"date"` IP string `json:"ip"` UserAgent string `json:"user_agent"` }
TOSAcceptanceParams is the structure for TOS acceptance.
func (*TOSAcceptanceParams) AppendDetails ¶
func (t *TOSAcceptanceParams) AppendDetails(values *url.Values)
AppendDetails adds the terms of service acceptance to the query string.
type Token ¶
type Token struct { ID string `json:"id"` Live bool `json:"livemode"` Created int64 `json:"created"` Type TokenType `json:"type"` Used bool `json:"used"` Bank *BankAccount `json:"bank_account"` Card *Card `json:"card"` ClientIP string `json:"client_ip"` // Email is an undocumented field but included for all tokens created // with Stripe Checkout. Email string `json:"email"` }
Token is the resource representing a Stripe token. For more details see https://stripe.com/docs/api#tokens.
type TokenParams ¶
type TokenParams struct { Params Card *CardParams Bank *BankAccountParams Customer string // Email is an undocumented parameter used by Stripe Checkout // It may be removed from the API without notice. Email string }
TokenParams is the set of parameters that can be used when creating a token. For more details see https://stripe.com/docs/api#create_card_token and https://stripe.com/docs/api#create_bank_account_token.
type TokenType ¶
type TokenType string
TokenType is the list of allowed values for a token's type. Allowed values are "card", "bank_account".
type Transaction ¶
type Transaction struct { ID string `json:"id"` Amount int64 `json:"amount"` Currency Currency `json:"currency"` Available int64 `json:"available_on"` Created int64 `json:"created"` Fee int64 `json:"fee"` FeeDetails []TxFee `json:"fee_details"` Net int64 `json:"net"` Status TransactionStatus `json:"status"` Type TransactionType `json:"type"` Desc string `json:"description"` Src string `json:"source"` Recipient string `json:"recipient"` }
Transaction is the resource representing the balance transaction. For more details see https://stripe.com/docs/api/#balance.
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) 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 TransactionStatus ¶
type TransactionStatus string
TransactionStatus is the list of allowed values for the transaction's status. Allowed values are "available", "pending".
type TransactionType ¶
type TransactionType string
TransactionType is the list of allowed values for the transaction's type. Allowed values are "charge", "refund", "adjustment", "application_fee", "application_fee_refund", "transfer", "transfer_cancel", "transfer_failure".
type Transfer ¶
type Transfer struct { ID string `json:"id"` Live bool `json:"livemode"` Amount int64 `json:"amount"` Currency Currency `json:"currency"` Created int64 `json:"created"` Date int64 `json:"date"` Desc string `json:"description"` FailCode TransferFailCode `json:"failure_code"` FailMsg string `json:"failure_message"` Status TransferStatus `json:"status"` Type TransferType `json:"type"` Tx *Transaction `json:"balance_transaction"` Meta map[string]string `json:"metadata"` Bank *BankAccount `json:"bank_account"` Card *Card `json:"card"` Recipient *Recipient `json:"recipient"` Statement string `json:"statement_descriptor"` Reversals *ReversalList `json:"reversals"` }
Transfer is the resource representing a Stripe transfer. For more details see https://stripe.com/docs/api#transfers.
type TransferFailCode ¶
type TransferFailCode string
TransferFailCode is the list of allowed values for the transfer's failure code. Allowed values are "insufficient_funds", "account_closed", "no_account", "invalid_account_number", "debit_not_authorized", "bank_ownership_changed", "account_frozen", "could_not_process", "bank_account_restricted", "invalid_currency".
type TransferListParams ¶
type TransferListParams struct { ListParams Created, Date int64 Recipient string Status TransferStatus }
TransferListParams is the set of parameters that can be used when listing transfers. For more details see https://stripe.com/docs/api#list_transfers.
type TransferParams ¶
type TransferParams struct { Params Amount int64 Fee uint64 Currency Currency Recipient, Desc, Statement, Bank, Card, SourceTx, Dest string }
TransferParams is the set of parameters that can be used when creating or updating a transfer. For more details see https://stripe.com/docs/api#create_transfer and https://stripe.com/docs/api#update_transfer.
type TransferSchedule ¶
type TransferSchedule struct { Delay uint64 `json:"delay_days"` Interval Interval `json:"interval"` WeekAnchor string `json:"weekly_anchor"` MonthAnchor uint64 `json:"monthly_anchor"` }
TransferSchedule is the structure for an account's transfer schedule.
type TransferScheduleParams ¶
type TransferScheduleParams struct {
Delay, MonthAnchor uint64
WeekAnchor string
Interval Interval
MinimumDelay bool
}
TransferScheduleParams are the parameters allowed for transfer schedules.
func (*TransferScheduleParams) AppendDetails ¶
func (t *TransferScheduleParams) AppendDetails(values *url.Values)
AppendDetails adds the transfer schedule to the query string.
type TransferStatus ¶
type TransferStatus string
TransferStatus is the list of allowed values for the transfer's status. Allowed values are "paid", "pending", "failed", "canceled".
type TransferType ¶
type TransferType string
TransferType is the list of allowed values for the transfer's type. Allowed values are "card", "bank_account".
type TxFee ¶
type TxFee struct { Amount int64 `json:"amount"` Currency Currency `json:"currency"` Type string `json:"type"` Desc string `json:"description"` Application string `json:"application"` }
TxFee is a structure that breaks down the fees in a transaction.
type TxListParams ¶
type TxListParams struct { ListParams Created, Available int64 Currency, Src, Transfer string Type TransactionType }
TxListParams 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 TxParams ¶
type TxParams struct {
Params
}
TxParams 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 Verification ¶
type Verification string
Verification is the list of allowed verification responses. Allowed values are "pass", "fail", "unchecked", "unavailabe".
Source Files ¶
- account.go
- balance.go
- bankaccount.go
- bitcoin_receiver.go
- bitcoin_transaction.go
- card.go
- charge.go
- coupon.go
- customer.go
- discounts.go
- dispute.go
- error.go
- event.go
- fee.go
- feerefund.go
- fileupload.go
- invoice.go
- invoiceitem.go
- iter.go
- params.go
- payment_source.go
- plan.go
- recipient.go
- refund.go
- reversal.go
- stripe.go
- sub.go
- token.go
- transfer.go
Directories ¶
Path | Synopsis |
---|---|
Package account provides the /account APIs
|
Package account provides the /account APIs |
Package balance provides the /balance APIs
|
Package balance provides the /balance APIs |
Package bankaccount provides the /bank_accounts APIs
|
Package bankaccount provides the /bank_accounts APIs |
Package bitcoinreceiver provides the /bitcoin/receivers APIs.
|
Package bitcoinreceiver provides the /bitcoin/receivers APIs. |
Package bitcointransaction provides the /bitcoin/transactions APIs.
|
Package bitcointransaction provides the /bitcoin/transactions APIs. |
Package card provides the /cards APIs
|
Package card provides the /cards APIs |
Package charge provides the /charges APIs
|
Package charge provides the /charges APIs |
Package client provides a Stripe client for invoking APIs across all resources
|
Package client provides a Stripe client for invoking APIs across all resources |
Package coupon provides the /coupons APIs
|
Package coupon provides the /coupons APIs |
Package currency provides the list of currency codes
|
Package currency provides the list of currency codes |
Package customer provides the /customes APIs
|
Package customer provides the /customes APIs |
Package discount provides the discount-related APIs
|
Package discount provides the discount-related APIs |
Package dispute provides the dispute-related APIs
|
Package dispute provides the dispute-related APIs |
Package event provides the /events APIs
|
Package event provides the /events APIs |
Package fee provides the /application_fees APIs
|
Package fee provides the /application_fees APIs |
Package feerefund provides the /application_fees/refunds APIs
|
Package feerefund provides the /application_fees/refunds APIs |
Package fileupload provides the file upload related APIs
|
Package fileupload provides the file upload related APIs |
Package invoice provides the /invoices APIs
|
Package invoice provides the /invoices APIs |
Package invoiceitem provides the /invoiceitems APIs
|
Package invoiceitem provides the /invoiceitems APIs |
Package paymentsource provides the /sources APIs
|
Package paymentsource provides the /sources APIs |
Package plan provides the /plans APIs
|
Package plan provides the /plans APIs |
Package recipient provides the /recipients APIs
|
Package recipient provides the /recipients APIs |
Package refund provides the /refunds APIs
|
Package refund provides the /refunds APIs |
Package reversal provides the /transfers/reversals APIs
|
Package reversal provides the /transfers/reversals APIs |
Package sub provides the /subscriptions APIs
|
Package sub provides the /subscriptions APIs |
Package token provides the /tokens APIs
|
Package token provides the /tokens APIs |
Package transfer provides the /transfers APIs
|
Package transfer provides the /transfers APIs |
Package utils provides internal utilities
|
Package utils provides internal utilities |