github.com/stripe/stripe-go/v76@v76.25.0/accountsession.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // The list of features enabled in the embedded component.
    10  type AccountSessionComponentsAccountOnboardingFeaturesParams struct{}
    11  
    12  // Configuration for the account onboarding embedded component.
    13  type AccountSessionComponentsAccountOnboardingParams struct {
    14  	// Whether the embedded component is enabled.
    15  	Enabled *bool `form:"enabled"`
    16  	// The list of features enabled in the embedded component.
    17  	Features *AccountSessionComponentsAccountOnboardingFeaturesParams `form:"features"`
    18  }
    19  
    20  // The list of features enabled in the embedded component.
    21  type AccountSessionComponentsDocumentsFeaturesParams struct{}
    22  
    23  // Configuration for the documents embedded component.
    24  type AccountSessionComponentsDocumentsParams struct {
    25  	// Whether the embedded component is enabled.
    26  	Enabled *bool `form:"enabled"`
    27  	// The list of features enabled in the embedded component.
    28  	Features *AccountSessionComponentsDocumentsFeaturesParams `form:"features"`
    29  }
    30  
    31  // The list of features enabled in the embedded component.
    32  type AccountSessionComponentsPaymentDetailsFeaturesParams struct {
    33  	// Whether to allow capturing and cancelling payment intents. This is `true` by default.
    34  	CapturePayments *bool `form:"capture_payments"`
    35  	// Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
    36  	DestinationOnBehalfOfChargeManagement *bool `form:"destination_on_behalf_of_charge_management"`
    37  	// Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
    38  	DisputeManagement *bool `form:"dispute_management"`
    39  	// Whether to allow sending refunds. This is `true` by default.
    40  	RefundManagement *bool `form:"refund_management"`
    41  }
    42  
    43  // Configuration for the payment details embedded component.
    44  type AccountSessionComponentsPaymentDetailsParams struct {
    45  	// Whether the embedded component is enabled.
    46  	Enabled *bool `form:"enabled"`
    47  	// The list of features enabled in the embedded component.
    48  	Features *AccountSessionComponentsPaymentDetailsFeaturesParams `form:"features"`
    49  }
    50  
    51  // The list of features enabled in the embedded component.
    52  type AccountSessionComponentsPaymentsFeaturesParams struct {
    53  	// Whether to allow capturing and cancelling payment intents. This is `true` by default.
    54  	CapturePayments *bool `form:"capture_payments"`
    55  	// Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
    56  	DestinationOnBehalfOfChargeManagement *bool `form:"destination_on_behalf_of_charge_management"`
    57  	// Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
    58  	DisputeManagement *bool `form:"dispute_management"`
    59  	// Whether to allow sending refunds. This is `true` by default.
    60  	RefundManagement *bool `form:"refund_management"`
    61  }
    62  
    63  // Configuration for the payments embedded component.
    64  type AccountSessionComponentsPaymentsParams struct {
    65  	// Whether the embedded component is enabled.
    66  	Enabled *bool `form:"enabled"`
    67  	// The list of features enabled in the embedded component.
    68  	Features *AccountSessionComponentsPaymentsFeaturesParams `form:"features"`
    69  }
    70  
    71  // The list of features enabled in the embedded component.
    72  type AccountSessionComponentsPayoutsFeaturesParams struct {
    73  	// Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
    74  	EditPayoutSchedule *bool `form:"edit_payout_schedule"`
    75  	// Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
    76  	InstantPayouts *bool `form:"instant_payouts"`
    77  	// Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
    78  	StandardPayouts *bool `form:"standard_payouts"`
    79  }
    80  
    81  // Configuration for the payouts embedded component.
    82  type AccountSessionComponentsPayoutsParams struct {
    83  	// Whether the embedded component is enabled.
    84  	Enabled *bool `form:"enabled"`
    85  	// The list of features enabled in the embedded component.
    86  	Features *AccountSessionComponentsPayoutsFeaturesParams `form:"features"`
    87  }
    88  
    89  // Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).
    90  type AccountSessionComponentsParams struct {
    91  	// Configuration for the account onboarding embedded component.
    92  	AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"`
    93  	// Configuration for the documents embedded component.
    94  	Documents *AccountSessionComponentsDocumentsParams `form:"documents"`
    95  	// Configuration for the payment details embedded component.
    96  	PaymentDetails *AccountSessionComponentsPaymentDetailsParams `form:"payment_details"`
    97  	// Configuration for the payments embedded component.
    98  	Payments *AccountSessionComponentsPaymentsParams `form:"payments"`
    99  	// Configuration for the payouts embedded component.
   100  	Payouts *AccountSessionComponentsPayoutsParams `form:"payouts"`
   101  }
   102  
   103  // Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
   104  type AccountSessionParams struct {
   105  	Params `form:"*"`
   106  	// The identifier of the account to create an Account Session for.
   107  	Account *string `form:"account"`
   108  	// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).
   109  	Components *AccountSessionComponentsParams `form:"components"`
   110  	// Specifies which fields in the response should be expanded.
   111  	Expand []*string `form:"expand"`
   112  }
   113  
   114  // AddExpand appends a new field to expand.
   115  func (p *AccountSessionParams) AddExpand(f string) {
   116  	p.Expand = append(p.Expand, &f)
   117  }
   118  
   119  type AccountSessionComponentsAccountOnboardingFeatures struct{}
   120  type AccountSessionComponentsAccountOnboarding struct {
   121  	// Whether the embedded component is enabled.
   122  	Enabled  bool                                               `json:"enabled"`
   123  	Features *AccountSessionComponentsAccountOnboardingFeatures `json:"features"`
   124  }
   125  type AccountSessionComponentsDocumentsFeatures struct{}
   126  type AccountSessionComponentsDocuments struct {
   127  	// Whether the embedded component is enabled.
   128  	Enabled  bool                                       `json:"enabled"`
   129  	Features *AccountSessionComponentsDocumentsFeatures `json:"features"`
   130  }
   131  type AccountSessionComponentsPaymentDetailsFeatures struct {
   132  	// Whether to allow capturing and cancelling payment intents. This is `true` by default.
   133  	CapturePayments bool `json:"capture_payments"`
   134  	// Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
   135  	DestinationOnBehalfOfChargeManagement bool `json:"destination_on_behalf_of_charge_management"`
   136  	// Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
   137  	DisputeManagement bool `json:"dispute_management"`
   138  	// Whether to allow sending refunds. This is `true` by default.
   139  	RefundManagement bool `json:"refund_management"`
   140  }
   141  type AccountSessionComponentsPaymentDetails struct {
   142  	// Whether the embedded component is enabled.
   143  	Enabled  bool                                            `json:"enabled"`
   144  	Features *AccountSessionComponentsPaymentDetailsFeatures `json:"features"`
   145  }
   146  type AccountSessionComponentsPaymentsFeatures struct {
   147  	// Whether to allow capturing and cancelling payment intents. This is `true` by default.
   148  	CapturePayments bool `json:"capture_payments"`
   149  	// Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
   150  	DestinationOnBehalfOfChargeManagement bool `json:"destination_on_behalf_of_charge_management"`
   151  	// Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
   152  	DisputeManagement bool `json:"dispute_management"`
   153  	// Whether to allow sending refunds. This is `true` by default.
   154  	RefundManagement bool `json:"refund_management"`
   155  }
   156  type AccountSessionComponentsPayments struct {
   157  	// Whether the embedded component is enabled.
   158  	Enabled  bool                                      `json:"enabled"`
   159  	Features *AccountSessionComponentsPaymentsFeatures `json:"features"`
   160  }
   161  type AccountSessionComponentsPayoutsFeatures struct {
   162  	// Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
   163  	EditPayoutSchedule bool `json:"edit_payout_schedule"`
   164  	// Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
   165  	InstantPayouts bool `json:"instant_payouts"`
   166  	// Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
   167  	StandardPayouts bool `json:"standard_payouts"`
   168  }
   169  type AccountSessionComponentsPayouts struct {
   170  	// Whether the embedded component is enabled.
   171  	Enabled  bool                                     `json:"enabled"`
   172  	Features *AccountSessionComponentsPayoutsFeatures `json:"features"`
   173  }
   174  type AccountSessionComponents struct {
   175  	AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"`
   176  	Documents         *AccountSessionComponentsDocuments         `json:"documents"`
   177  	PaymentDetails    *AccountSessionComponentsPaymentDetails    `json:"payment_details"`
   178  	Payments          *AccountSessionComponentsPayments          `json:"payments"`
   179  	Payouts           *AccountSessionComponentsPayouts           `json:"payouts"`
   180  }
   181  
   182  // An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components.
   183  //
   184  // We recommend that you create an AccountSession each time you need to display an embedded component
   185  // to your user. Do not save AccountSessions to your database as they expire relatively
   186  // quickly, and cannot be used more than once.
   187  //
   188  // Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
   189  type AccountSession struct {
   190  	APIResource
   191  	// The ID of the account the AccountSession was created for
   192  	Account string `json:"account"`
   193  	// The client secret of this AccountSession. Used on the client to set up secure access to the given `account`.
   194  	//
   195  	// The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.
   196  	//
   197  	// Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled.
   198  	ClientSecret string                    `json:"client_secret"`
   199  	Components   *AccountSessionComponents `json:"components"`
   200  	// The timestamp at which this AccountSession will expire.
   201  	ExpiresAt int64 `json:"expires_at"`
   202  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
   203  	Livemode bool `json:"livemode"`
   204  	// String representing the object's type. Objects of the same type share the same value.
   205  	Object string `json:"object"`
   206  }