github.com/stripe/stripe-go/v76@v76.25.0/source.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). 10 type SourceCodeVerificationStatus string 11 12 // List of values that SourceCodeVerificationStatus can take 13 const ( 14 SourceCodeVerificationStatusFailed SourceCodeVerificationStatus = "failed" 15 SourceCodeVerificationStatusPending SourceCodeVerificationStatus = "pending" 16 SourceCodeVerificationStatusSucceeded SourceCodeVerificationStatus = "succeeded" 17 ) 18 19 // The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. 20 type SourceFlow string 21 22 // List of values that SourceFlow can take 23 const ( 24 SourceFlowCodeVerification SourceFlow = "code_verification" 25 SourceFlowNone SourceFlow = "none" 26 SourceFlowReceiver SourceFlow = "receiver" 27 SourceFlowRedirect SourceFlow = "redirect" 28 ) 29 30 // Type of refund attribute method, one of `email`, `manual`, or `none`. 31 type SourceReceiverRefundAttributesMethod string 32 33 // List of values that SourceReceiverRefundAttributesMethod can take 34 const ( 35 SourceReceiverRefundAttributesMethodEmail SourceReceiverRefundAttributesMethod = "email" 36 SourceReceiverRefundAttributesMethodManual SourceReceiverRefundAttributesMethod = "manual" 37 SourceReceiverRefundAttributesMethodNone SourceReceiverRefundAttributesMethod = "none" 38 ) 39 40 // Type of refund attribute status, one of `missing`, `requested`, or `available`. 41 type SourceReceiverRefundAttributesStatus string 42 43 // List of values that SourceReceiverRefundAttributesStatus can take 44 const ( 45 SourceReceiverRefundAttributesStatusAvailable SourceReceiverRefundAttributesStatus = "available" 46 SourceReceiverRefundAttributesStatusMissing SourceReceiverRefundAttributesStatus = "missing" 47 SourceReceiverRefundAttributesStatusRequested SourceReceiverRefundAttributesStatus = "requested" 48 ) 49 50 // The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. 51 type SourceRedirectFailureReason string 52 53 // List of values that SourceRedirectFailureReason can take 54 const ( 55 SourceRedirectFailureReasonDeclined SourceRedirectFailureReason = "declined" 56 SourceRedirectFailureReasonProcessingError SourceRedirectFailureReason = "processing_error" 57 SourceRedirectFailureReasonUserAbort SourceRedirectFailureReason = "user_abort" 58 ) 59 60 // The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). 61 type SourceRedirectStatus string 62 63 // List of values that SourceRedirectStatus can take 64 const ( 65 SourceRedirectStatusFailed SourceRedirectStatus = "failed" 66 SourceRedirectStatusNotRequired SourceRedirectStatus = "not_required" 67 SourceRedirectStatusPending SourceRedirectStatus = "pending" 68 SourceRedirectStatusSucceeded SourceRedirectStatus = "succeeded" 69 ) 70 71 // The type of this order item. Must be `sku`, `tax`, or `shipping`. 72 type SourceSourceOrderItemType string 73 74 // List of values that SourceSourceOrderItemType can take 75 const ( 76 SourceSourceOrderItemTypeDiscount SourceSourceOrderItemType = "discount" 77 SourceSourceOrderItemTypeSKU SourceSourceOrderItemType = "sku" 78 SourceSourceOrderItemTypeShipping SourceSourceOrderItemType = "shipping" 79 SourceSourceOrderItemTypeTax SourceSourceOrderItemType = "tax" 80 ) 81 82 // The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. 83 type SourceStatus string 84 85 // List of values that SourceStatus can take 86 const ( 87 SourceStatusCanceled SourceStatus = "canceled" 88 SourceStatusChargeable SourceStatus = "chargeable" 89 SourceStatusConsumed SourceStatus = "consumed" 90 SourceStatusFailed SourceStatus = "failed" 91 SourceStatusPending SourceStatus = "pending" 92 ) 93 94 // Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. 95 type SourceUsage string 96 97 // List of values that SourceUsage can take 98 const ( 99 SourceUsageReusable SourceUsage = "reusable" 100 SourceUsageSingleUse SourceUsage = "single_use" 101 ) 102 103 // Delete a specified source for a given customer. 104 type SourceDetachParams struct { 105 Params `form:"*"` 106 Customer *string `form:"-"` // Included in URL 107 // Specifies which fields in the response should be expanded. 108 Expand []*string `form:"expand"` 109 } 110 111 // AddExpand appends a new field to expand. 112 func (p *SourceDetachParams) AddExpand(f string) { 113 p.Expand = append(p.Expand, &f) 114 } 115 116 // Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. 117 type SourceParams struct { 118 Params `form:"*"` 119 // Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. 120 Amount *int64 `form:"amount"` 121 // The client secret of the source. Required if a publishable key is used to retrieve the source. 122 ClientSecret *string `form:"client_secret"` 123 // Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. 124 Currency *string `form:"currency"` 125 // The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). 126 Customer *string `form:"customer"` 127 // Specifies which fields in the response should be expanded. 128 Expand []*string `form:"expand"` 129 // The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. 130 Flow *string `form:"flow"` 131 // Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. 132 Mandate *SourceMandateParams `form:"mandate"` 133 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. 134 Metadata map[string]string `form:"metadata"` 135 // The source to share. 136 OriginalSource *string `form:"original_source"` 137 // Information about the owner of the payment instrument that may be used or required by particular source types. 138 Owner *SourceOwnerParams `form:"owner"` 139 // Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). 140 Receiver *SourceReceiverParams `form:"receiver"` 141 // Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). 142 Redirect *SourceRedirectParams `form:"redirect"` 143 // Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. 144 SourceOrder *SourceSourceOrderParams `form:"source_order"` 145 // An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. 146 StatementDescriptor *string `form:"statement_descriptor"` 147 // An optional token used to create the source. When passed, token properties will override source parameters. 148 Token *string `form:"token"` 149 // The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) 150 Type *string `form:"type"` 151 Usage *string `form:"usage"` 152 } 153 154 // AddExpand appends a new field to expand. 155 func (p *SourceParams) AddExpand(f string) { 156 p.Expand = append(p.Expand, &f) 157 } 158 159 // AddMetadata adds a new key-value pair to the Metadata. 160 func (p *SourceParams) AddMetadata(key string, value string) { 161 if p.Metadata == nil { 162 p.Metadata = make(map[string]string) 163 } 164 165 p.Metadata[key] = value 166 } 167 168 // The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` 169 type SourceMandateAcceptanceOfflineParams struct { 170 // An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. 171 ContactEmail *string `form:"contact_email"` 172 } 173 174 // The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` 175 type SourceMandateAcceptanceOnlineParams struct { 176 // The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. 177 Date *int64 `form:"date"` 178 // The IP address from which the mandate was accepted or refused by the customer. 179 IP *string `form:"ip"` 180 // The user agent of the browser from which the mandate was accepted or refused by the customer. 181 UserAgent *string `form:"user_agent"` 182 } 183 184 // The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. 185 type SourceMandateAcceptanceParams struct { 186 // The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. 187 Date *int64 `form:"date"` 188 // The IP address from which the mandate was accepted or refused by the customer. 189 IP *string `form:"ip"` 190 // The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` 191 Offline *SourceMandateAcceptanceOfflineParams `form:"offline"` 192 // The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` 193 Online *SourceMandateAcceptanceOnlineParams `form:"online"` 194 // The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). 195 Status *string `form:"status"` 196 // The type of acceptance information included with the mandate. Either `online` or `offline` 197 Type *string `form:"type"` 198 // The user agent of the browser from which the mandate was accepted or refused by the customer. 199 UserAgent *string `form:"user_agent"` 200 } 201 202 // Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. 203 type SourceMandateParams struct { 204 // The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. 205 Acceptance *SourceMandateAcceptanceParams `form:"acceptance"` 206 // The amount specified by the mandate. (Leave null for a mandate covering all amounts) 207 Amount *int64 `form:"amount"` 208 // The currency specified by the mandate. (Must match `currency` of the source) 209 Currency *string `form:"currency"` 210 // The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) 211 Interval *string `form:"interval"` 212 // The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). 213 NotificationMethod *string `form:"notification_method"` 214 } 215 216 // Information about the owner of the payment instrument that may be used or required by particular source types. 217 type SourceOwnerParams struct { 218 // Owner's address. 219 Address *AddressParams `form:"address"` 220 // Owner's email address. 221 Email *string `form:"email"` 222 // Owner's full name. 223 Name *string `form:"name"` 224 // Owner's phone number. 225 Phone *string `form:"phone"` 226 } 227 228 // List of items constituting the order. 229 type SourceSourceOrderItemParams struct { 230 Amount *int64 `form:"amount"` 231 Currency *string `form:"currency"` 232 Description *string `form:"description"` 233 // The ID of the SKU being ordered. 234 Parent *string `form:"parent"` 235 // The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. 236 Quantity *int64 `form:"quantity"` 237 Type *string `form:"type"` 238 } 239 240 // Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. 241 type SourceSourceOrderParams struct { 242 // List of items constituting the order. 243 Items []*SourceSourceOrderItemParams `form:"items"` 244 // Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. 245 Shipping *ShippingDetailsParams `form:"shipping"` 246 } 247 248 // Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). 249 type SourceReceiverParams struct { 250 // The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. 251 RefundAttributesMethod *string `form:"refund_attributes_method"` 252 } 253 254 // Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). 255 type SourceRedirectParams struct { 256 // The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. 257 ReturnURL *string `form:"return_url"` 258 } 259 type SourceACHCreditTransfer struct { 260 AccountNumber string `json:"account_number"` 261 BankName string `json:"bank_name"` 262 Fingerprint string `json:"fingerprint"` 263 RefundAccountHolderName string `json:"refund_account_holder_name"` 264 RefundAccountHolderType string `json:"refund_account_holder_type"` 265 RefundRoutingNumber string `json:"refund_routing_number"` 266 RoutingNumber string `json:"routing_number"` 267 SwiftCode string `json:"swift_code"` 268 } 269 type SourceACHDebit struct { 270 BankName string `json:"bank_name"` 271 Country string `json:"country"` 272 Fingerprint string `json:"fingerprint"` 273 Last4 string `json:"last4"` 274 RoutingNumber string `json:"routing_number"` 275 Type string `json:"type"` 276 } 277 type SourceACSSDebit struct { 278 BankAddressCity string `json:"bank_address_city"` 279 BankAddressLine1 string `json:"bank_address_line_1"` 280 BankAddressLine2 string `json:"bank_address_line_2"` 281 BankAddressPostalCode string `json:"bank_address_postal_code"` 282 BankName string `json:"bank_name"` 283 Category string `json:"category"` 284 Country string `json:"country"` 285 Fingerprint string `json:"fingerprint"` 286 Last4 string `json:"last4"` 287 RoutingNumber string `json:"routing_number"` 288 } 289 type SourceAlipay struct { 290 DataString string `json:"data_string"` 291 NativeURL string `json:"native_url"` 292 StatementDescriptor string `json:"statement_descriptor"` 293 } 294 type SourceAUBECSDebit struct { 295 BSBNumber string `json:"bsb_number"` 296 Fingerprint string `json:"fingerprint"` 297 Last4 string `json:"last4"` 298 } 299 type SourceBancontact struct { 300 BankCode string `json:"bank_code"` 301 BankName string `json:"bank_name"` 302 BIC string `json:"bic"` 303 IBANLast4 string `json:"iban_last4"` 304 PreferredLanguage string `json:"preferred_language"` 305 StatementDescriptor string `json:"statement_descriptor"` 306 } 307 type SourceCard struct { 308 AddressLine1Check string `json:"address_line1_check"` 309 AddressZipCheck string `json:"address_zip_check"` 310 Brand string `json:"brand"` 311 Country string `json:"country"` 312 CVCCheck string `json:"cvc_check"` 313 Description string `json:"description"` 314 DynamicLast4 string `json:"dynamic_last4"` 315 ExpMonth int64 `json:"exp_month"` 316 ExpYear int64 `json:"exp_year"` 317 Fingerprint string `json:"fingerprint"` 318 Funding string `json:"funding"` 319 IIN string `json:"iin"` 320 Issuer string `json:"issuer"` 321 Last4 string `json:"last4"` 322 Name string `json:"name"` 323 ThreeDSecure string `json:"three_d_secure"` 324 TokenizationMethod string `json:"tokenization_method"` 325 } 326 type SourceCardPresent struct { 327 ApplicationCryptogram string `json:"application_cryptogram"` 328 ApplicationPreferredName string `json:"application_preferred_name"` 329 AuthorizationCode string `json:"authorization_code"` 330 AuthorizationResponseCode string `json:"authorization_response_code"` 331 Brand string `json:"brand"` 332 Country string `json:"country"` 333 CVMType string `json:"cvm_type"` 334 DataType string `json:"data_type"` 335 DedicatedFileName string `json:"dedicated_file_name"` 336 Description string `json:"description"` 337 EmvAuthData string `json:"emv_auth_data"` 338 EvidenceCustomerSignature string `json:"evidence_customer_signature"` 339 EvidenceTransactionCertificate string `json:"evidence_transaction_certificate"` 340 ExpMonth int64 `json:"exp_month"` 341 ExpYear int64 `json:"exp_year"` 342 Fingerprint string `json:"fingerprint"` 343 Funding string `json:"funding"` 344 IIN string `json:"iin"` 345 Issuer string `json:"issuer"` 346 Last4 string `json:"last4"` 347 POSDeviceID string `json:"pos_device_id"` 348 POSEntryMode string `json:"pos_entry_mode"` 349 Reader string `json:"reader"` 350 ReadMethod string `json:"read_method"` 351 TerminalVerificationResults string `json:"terminal_verification_results"` 352 TransactionStatusInformation string `json:"transaction_status_information"` 353 } 354 type SourceCodeVerification struct { 355 // The number of attempts remaining to authenticate the source object with a verification code. 356 AttemptsRemaining int64 `json:"attempts_remaining"` 357 // The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). 358 Status SourceCodeVerificationStatus `json:"status"` 359 } 360 type SourceEPS struct { 361 Reference string `json:"reference"` 362 StatementDescriptor string `json:"statement_descriptor"` 363 } 364 type SourceGiropay struct { 365 BankCode string `json:"bank_code"` 366 BankName string `json:"bank_name"` 367 BIC string `json:"bic"` 368 StatementDescriptor string `json:"statement_descriptor"` 369 } 370 type SourceIDEAL struct { 371 Bank string `json:"bank"` 372 BIC string `json:"bic"` 373 IBANLast4 string `json:"iban_last4"` 374 StatementDescriptor string `json:"statement_descriptor"` 375 } 376 type SourceKlarna struct { 377 BackgroundImageURL string `json:"background_image_url"` 378 ClientToken string `json:"client_token"` 379 FirstName string `json:"first_name"` 380 LastName string `json:"last_name"` 381 Locale string `json:"locale"` 382 LogoURL string `json:"logo_url"` 383 PageTitle string `json:"page_title"` 384 PayLaterAssetURLsDescriptive string `json:"pay_later_asset_urls_descriptive"` 385 PayLaterAssetURLsStandard string `json:"pay_later_asset_urls_standard"` 386 PayLaterName string `json:"pay_later_name"` 387 PayLaterRedirectURL string `json:"pay_later_redirect_url"` 388 PaymentMethodCategories string `json:"payment_method_categories"` 389 PayNowAssetURLsDescriptive string `json:"pay_now_asset_urls_descriptive"` 390 PayNowAssetURLsStandard string `json:"pay_now_asset_urls_standard"` 391 PayNowName string `json:"pay_now_name"` 392 PayNowRedirectURL string `json:"pay_now_redirect_url"` 393 PayOverTimeAssetURLsDescriptive string `json:"pay_over_time_asset_urls_descriptive"` 394 PayOverTimeAssetURLsStandard string `json:"pay_over_time_asset_urls_standard"` 395 PayOverTimeName string `json:"pay_over_time_name"` 396 PayOverTimeRedirectURL string `json:"pay_over_time_redirect_url"` 397 PurchaseCountry string `json:"purchase_country"` 398 PurchaseType string `json:"purchase_type"` 399 RedirectURL string `json:"redirect_url"` 400 ShippingDelay int64 `json:"shipping_delay"` 401 ShippingFirstName string `json:"shipping_first_name"` 402 ShippingLastName string `json:"shipping_last_name"` 403 } 404 type SourceMultibanco struct { 405 Entity string `json:"entity"` 406 Reference string `json:"reference"` 407 RefundAccountHolderAddressCity string `json:"refund_account_holder_address_city"` 408 RefundAccountHolderAddressCountry string `json:"refund_account_holder_address_country"` 409 RefundAccountHolderAddressLine1 string `json:"refund_account_holder_address_line1"` 410 RefundAccountHolderAddressLine2 string `json:"refund_account_holder_address_line2"` 411 RefundAccountHolderAddressPostalCode string `json:"refund_account_holder_address_postal_code"` 412 RefundAccountHolderAddressState string `json:"refund_account_holder_address_state"` 413 RefundAccountHolderName string `json:"refund_account_holder_name"` 414 RefundIBAN string `json:"refund_iban"` 415 } 416 417 // Information about the owner of the payment instrument that may be used or required by particular source types. 418 type SourceOwner struct { 419 // Owner's address. 420 Address *Address `json:"address"` 421 // Owner's email address. 422 Email string `json:"email"` 423 // Owner's full name. 424 Name string `json:"name"` 425 // Owner's phone number (including extension). 426 Phone string `json:"phone"` 427 // Verified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. 428 VerifiedAddress *Address `json:"verified_address"` 429 // Verified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. 430 VerifiedEmail string `json:"verified_email"` 431 // Verified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. 432 VerifiedName string `json:"verified_name"` 433 // Verified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. 434 VerifiedPhone string `json:"verified_phone"` 435 } 436 type SourceP24 struct { 437 Reference string `json:"reference"` 438 } 439 type SourceReceiver struct { 440 // The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. 441 Address string `json:"address"` 442 // The total amount that was moved to your balance. This is almost always equal to the amount charged. In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. The amount charged is expressed in the source's currency. 443 AmountCharged int64 `json:"amount_charged"` 444 // The total amount received by the receiver source. `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. The amount received is expressed in the source's currency. 445 AmountReceived int64 `json:"amount_received"` 446 // The total amount that was returned to the customer. The amount returned is expressed in the source's currency. 447 AmountReturned int64 `json:"amount_returned"` 448 // Type of refund attribute method, one of `email`, `manual`, or `none`. 449 RefundAttributesMethod SourceReceiverRefundAttributesMethod `json:"refund_attributes_method"` 450 // Type of refund attribute status, one of `missing`, `requested`, or `available`. 451 RefundAttributesStatus SourceReceiverRefundAttributesStatus `json:"refund_attributes_status"` 452 } 453 type SourceRedirect struct { 454 // The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. 455 FailureReason SourceRedirectFailureReason `json:"failure_reason"` 456 // The URL you provide to redirect the customer to after they authenticated their payment. 457 ReturnURL string `json:"return_url"` 458 // The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). 459 Status SourceRedirectStatus `json:"status"` 460 // The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. 461 URL string `json:"url"` 462 } 463 type SourceSEPACreditTransfer struct { 464 BankName string `json:"bank_name"` 465 BIC string `json:"bic"` 466 IBAN string `json:"iban"` 467 RefundAccountHolderAddressCity string `json:"refund_account_holder_address_city"` 468 RefundAccountHolderAddressCountry string `json:"refund_account_holder_address_country"` 469 RefundAccountHolderAddressLine1 string `json:"refund_account_holder_address_line1"` 470 RefundAccountHolderAddressLine2 string `json:"refund_account_holder_address_line2"` 471 RefundAccountHolderAddressPostalCode string `json:"refund_account_holder_address_postal_code"` 472 RefundAccountHolderAddressState string `json:"refund_account_holder_address_state"` 473 RefundAccountHolderName string `json:"refund_account_holder_name"` 474 RefundIBAN string `json:"refund_iban"` 475 } 476 type SourceSEPADebit struct { 477 BankCode string `json:"bank_code"` 478 BranchCode string `json:"branch_code"` 479 Country string `json:"country"` 480 Fingerprint string `json:"fingerprint"` 481 Last4 string `json:"last4"` 482 MandateReference string `json:"mandate_reference"` 483 MandateURL string `json:"mandate_url"` 484 } 485 type SourceSofort struct { 486 BankCode string `json:"bank_code"` 487 BankName string `json:"bank_name"` 488 BIC string `json:"bic"` 489 Country string `json:"country"` 490 IBANLast4 string `json:"iban_last4"` 491 PreferredLanguage string `json:"preferred_language"` 492 StatementDescriptor string `json:"statement_descriptor"` 493 } 494 495 // List of items constituting the order. 496 type SourceSourceOrderItem struct { 497 // The amount (price) for this order item. 498 Amount int64 `json:"amount"` 499 // This currency of this order item. Required when `amount` is present. 500 Currency Currency `json:"currency"` 501 // Human-readable description for this order item. 502 Description string `json:"description"` 503 // The ID of the associated object for this line item. Expandable if not null (e.g., expandable to a SKU). 504 Parent string `json:"parent"` 505 // The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. 506 Quantity int64 `json:"quantity"` 507 // The type of this order item. Must be `sku`, `tax`, or `shipping`. 508 Type SourceSourceOrderItemType `json:"type"` 509 } 510 type SourceSourceOrder struct { 511 // A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. 512 Amount int64 `json:"amount"` 513 // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). 514 Currency Currency `json:"currency"` 515 // The email address of the customer placing the order. 516 Email string `json:"email"` 517 // List of items constituting the order. 518 Items []*SourceSourceOrderItem `json:"items"` 519 Shipping ShippingDetails `json:"shipping"` 520 } 521 type SourceThreeDSecure struct { 522 AddressLine1Check string `json:"address_line1_check"` 523 AddressZipCheck string `json:"address_zip_check"` 524 Authenticated bool `json:"authenticated"` 525 Brand string `json:"brand"` 526 Card string `json:"card"` 527 Country string `json:"country"` 528 Customer string `json:"customer"` 529 CVCCheck string `json:"cvc_check"` 530 Description string `json:"description"` 531 DynamicLast4 string `json:"dynamic_last4"` 532 ExpMonth int64 `json:"exp_month"` 533 ExpYear int64 `json:"exp_year"` 534 Fingerprint string `json:"fingerprint"` 535 Funding string `json:"funding"` 536 IIN string `json:"iin"` 537 Issuer string `json:"issuer"` 538 Last4 string `json:"last4"` 539 Name string `json:"name"` 540 ThreeDSecure string `json:"three_d_secure"` 541 TokenizationMethod string `json:"tokenization_method"` 542 } 543 type SourceWeChat struct { 544 PrepayID string `json:"prepay_id"` 545 QRCodeURL string `json:"qr_code_url"` 546 StatementDescriptor string `json:"statement_descriptor"` 547 } 548 549 // `Source` objects allow you to accept a variety of payment methods. They 550 // represent a customer's payment instrument, and can be used with the Stripe API 551 // just like a `Card` object: once chargeable, they can be charged, or can be 552 // attached to customers. 553 // 554 // Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). 555 // We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). 556 // This newer API provides access to our latest features and payment method types. 557 // 558 // Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). 559 type Source struct { 560 APIResource 561 ACHCreditTransfer *SourceACHCreditTransfer `json:"ach_credit_transfer"` 562 ACHDebit *SourceACHDebit `json:"ach_debit"` 563 ACSSDebit *SourceACSSDebit `json:"acss_debit"` 564 Alipay *SourceAlipay `json:"alipay"` 565 // A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. 566 Amount int64 `json:"amount"` 567 AUBECSDebit *SourceAUBECSDebit `json:"au_becs_debit"` 568 Bancontact *SourceBancontact `json:"bancontact"` 569 Card *SourceCard `json:"card"` 570 CardPresent *SourceCardPresent `json:"card_present"` 571 // The client secret of the source. Used for client-side retrieval using a publishable key. 572 ClientSecret string `json:"client_secret"` 573 CodeVerification *SourceCodeVerification `json:"code_verification"` 574 // Time at which the object was created. Measured in seconds since the Unix epoch. 575 Created int64 `json:"created"` 576 // Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources. 577 Currency Currency `json:"currency"` 578 // The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. 579 Customer string `json:"customer"` 580 EPS *SourceEPS `json:"eps"` 581 // The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. 582 Flow SourceFlow `json:"flow"` 583 Giropay *SourceGiropay `json:"giropay"` 584 // Unique identifier for the object. 585 ID string `json:"id"` 586 IDEAL *SourceIDEAL `json:"ideal"` 587 Klarna *SourceKlarna `json:"klarna"` 588 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 589 Livemode bool `json:"livemode"` 590 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 591 Metadata map[string]string `json:"metadata"` 592 Multibanco *SourceMultibanco `json:"multibanco"` 593 // String representing the object's type. Objects of the same type share the same value. 594 Object string `json:"object"` 595 // Information about the owner of the payment instrument that may be used or required by particular source types. 596 Owner *SourceOwner `json:"owner"` 597 P24 *SourceP24 `json:"p24"` 598 Receiver *SourceReceiver `json:"receiver"` 599 Redirect *SourceRedirect `json:"redirect"` 600 SEPACreditTransfer *SourceSEPACreditTransfer `json:"sepa_credit_transfer"` 601 SEPADebit *SourceSEPADebit `json:"sepa_debit"` 602 Sofort *SourceSofort `json:"sofort"` 603 SourceOrder *SourceSourceOrder `json:"source_order"` 604 // Extra information about a source. This will appear on your customer's statement every time you charge the source. 605 StatementDescriptor string `json:"statement_descriptor"` 606 // The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. 607 Status SourceStatus `json:"status"` 608 ThreeDSecure *SourceThreeDSecure `json:"three_d_secure"` 609 // The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. 610 Type string `json:"type"` 611 // Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. 612 Usage SourceUsage `json:"usage"` 613 WeChat *SourceWeChat `json:"wechat"` 614 }