github.com/stripe/stripe-go/v76@v76.25.0/financialconnections_session.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // Type of account holder that this account belongs to. 10 type FinancialConnectionsSessionAccountHolderType string 11 12 // List of values that FinancialConnectionsSessionAccountHolderType can take 13 const ( 14 FinancialConnectionsSessionAccountHolderTypeAccount FinancialConnectionsSessionAccountHolderType = "account" 15 FinancialConnectionsSessionAccountHolderTypeCustomer FinancialConnectionsSessionAccountHolderType = "customer" 16 ) 17 18 // Permissions requested for accounts collected during this session. 19 type FinancialConnectionsSessionPermission string 20 21 // List of values that FinancialConnectionsSessionPermission can take 22 const ( 23 FinancialConnectionsSessionPermissionBalances FinancialConnectionsSessionPermission = "balances" 24 FinancialConnectionsSessionPermissionOwnership FinancialConnectionsSessionPermission = "ownership" 25 FinancialConnectionsSessionPermissionPaymentMethod FinancialConnectionsSessionPermission = "payment_method" 26 FinancialConnectionsSessionPermissionTransactions FinancialConnectionsSessionPermission = "transactions" 27 ) 28 29 // Data features requested to be retrieved upon account creation. 30 type FinancialConnectionsSessionPrefetch string 31 32 // List of values that FinancialConnectionsSessionPrefetch can take 33 const ( 34 FinancialConnectionsSessionPrefetchBalances FinancialConnectionsSessionPrefetch = "balances" 35 FinancialConnectionsSessionPrefetchOwnership FinancialConnectionsSessionPrefetch = "ownership" 36 FinancialConnectionsSessionPrefetchTransactions FinancialConnectionsSessionPrefetch = "transactions" 37 ) 38 39 // Retrieves the details of a Financial Connections Session 40 type FinancialConnectionsSessionParams struct { 41 Params `form:"*"` 42 // The account holder to link accounts for. 43 AccountHolder *FinancialConnectionsSessionAccountHolderParams `form:"account_holder"` 44 // Specifies which fields in the response should be expanded. 45 Expand []*string `form:"expand"` 46 // Filters to restrict the kinds of accounts to collect. 47 Filters *FinancialConnectionsSessionFiltersParams `form:"filters"` 48 // List of data features that you would like to request access to. 49 // 50 // Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. 51 Permissions []*string `form:"permissions"` 52 // List of data features that you would like to retrieve upon account creation. 53 Prefetch []*string `form:"prefetch"` 54 // For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. 55 ReturnURL *string `form:"return_url"` 56 } 57 58 // AddExpand appends a new field to expand. 59 func (p *FinancialConnectionsSessionParams) AddExpand(f string) { 60 p.Expand = append(p.Expand, &f) 61 } 62 63 // The account holder to link accounts for. 64 type FinancialConnectionsSessionAccountHolderParams struct { 65 // The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. 66 Account *string `form:"account"` 67 // The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. 68 Customer *string `form:"customer"` 69 // Type of account holder to collect accounts for. 70 Type *string `form:"type"` 71 } 72 73 // Filters to restrict the kinds of accounts to collect. 74 type FinancialConnectionsSessionFiltersParams struct { 75 // List of countries from which to collect accounts. 76 Countries []*string `form:"countries"` 77 } 78 79 // The account holder for whom accounts are collected in this session. 80 type FinancialConnectionsSessionAccountHolder struct { 81 // The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. 82 Account *Account `json:"account"` 83 // ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. 84 Customer *Customer `json:"customer"` 85 // Type of account holder that this account belongs to. 86 Type FinancialConnectionsSessionAccountHolderType `json:"type"` 87 } 88 type FinancialConnectionsSessionFilters struct { 89 // List of countries from which to filter accounts. 90 Countries []string `json:"countries"` 91 } 92 93 // A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. 94 type FinancialConnectionsSession struct { 95 APIResource 96 // The account holder for whom accounts are collected in this session. 97 AccountHolder *FinancialConnectionsSessionAccountHolder `json:"account_holder"` 98 // The accounts that were collected as part of this Session. 99 Accounts *FinancialConnectionsAccountList `json:"accounts"` 100 // A value that will be passed to the client to launch the authentication flow. 101 ClientSecret string `json:"client_secret"` 102 Filters *FinancialConnectionsSessionFilters `json:"filters"` 103 // Unique identifier for the object. 104 ID string `json:"id"` 105 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 106 Livemode bool `json:"livemode"` 107 // String representing the object's type. Objects of the same type share the same value. 108 Object string `json:"object"` 109 // Permissions requested for accounts collected during this session. 110 Permissions []FinancialConnectionsSessionPermission `json:"permissions"` 111 // Data features requested to be retrieved upon account creation. 112 Prefetch []FinancialConnectionsSessionPrefetch `json:"prefetch"` 113 // For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. 114 ReturnURL string `json:"return_url"` 115 }