Class: Stripe::SetupIntentService::CreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/services/setup_intent_service.rb

Defined Under Namespace

Classes: AutomaticPaymentMethods, MandateData, PaymentMethodData, PaymentMethodOptions, SingleUse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(attach_to_self: nil, automatic_payment_methods: nil, confirm: nil, confirmation_token: nil, customer: nil, customer_account: nil, description: nil, expand: nil, flow_directions: nil, mandate_data: nil, metadata: nil, on_behalf_of: nil, payment_method: nil, payment_method_configuration: nil, payment_method_data: nil, payment_method_options: nil, payment_method_types: nil, return_url: nil, single_use: nil, usage: nil, use_stripe_sdk: nil) ⇒ CreateParams

Returns a new instance of CreateParams.



1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/stripe/services/setup_intent_service.rb', line 1319

def initialize(
  attach_to_self: nil,
  automatic_payment_methods: nil,
  confirm: nil,
  confirmation_token: nil,
  customer: nil,
  customer_account: nil,
  description: nil,
  expand: nil,
  flow_directions: nil,
  mandate_data: nil,
  metadata: nil,
  on_behalf_of: nil,
  payment_method: nil,
  payment_method_configuration: nil,
  payment_method_data: nil,
  payment_method_options: nil,
  payment_method_types: nil,
  return_url: nil,
  single_use: nil,
  usage: nil,
  use_stripe_sdk: nil
)
  @attach_to_self = attach_to_self
  @automatic_payment_methods = automatic_payment_methods
  @confirm = confirm
  @confirmation_token = confirmation_token
  @customer = customer
  @customer_account = 
  @description = description
  @expand = expand
  @flow_directions = flow_directions
  @mandate_data = mandate_data
  @metadata = 
  @on_behalf_of = on_behalf_of
  @payment_method = payment_method
  @payment_method_configuration = payment_method_configuration
  @payment_method_data = payment_method_data
  @payment_method_options = payment_method_options
  @payment_method_types = payment_method_types
  @return_url = return_url
  @single_use = single_use
  @usage = usage
  @use_stripe_sdk = use_stripe_sdk
end

Instance Attribute Details

#attach_to_selfObject

If present, the SetupIntent’s payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.



1266
1267
1268
# File 'lib/stripe/services/setup_intent_service.rb', line 1266

def attach_to_self
  @attach_to_self
end

#automatic_payment_methodsObject

When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.



1268
1269
1270
# File 'lib/stripe/services/setup_intent_service.rb', line 1268

def automatic_payment_methods
  @automatic_payment_methods
end

#confirmObject

Set to ‘true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary.



1270
1271
1272
# File 'lib/stripe/services/setup_intent_service.rb', line 1270

def confirm
  @confirm
end

#confirmation_tokenObject

ID of the ConfirmationToken used to confirm this SetupIntent.

If the provided ConfirmationToken contains properties that are also being provided in this request, such as ‘payment_method`, then the values in this request will take precedence.



1274
1275
1276
# File 'lib/stripe/services/setup_intent_service.rb', line 1274

def confirmation_token
  @confirmation_token
end

#customerObject

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.



1278
1279
1280
# File 'lib/stripe/services/setup_intent_service.rb', line 1278

def customer
  @customer
end

#customer_accountObject

ID of the Account this SetupIntent belongs to, if one exists.

If present, the SetupIntent’s payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent.



1282
1283
1284
# File 'lib/stripe/services/setup_intent_service.rb', line 1282

def 
  @customer_account
end

#descriptionObject

An arbitrary string attached to the object. Often useful for displaying to users.



1284
1285
1286
# File 'lib/stripe/services/setup_intent_service.rb', line 1284

def description
  @description
end

#expandObject

Specifies which fields in the response should be expanded.



1286
1287
1288
# File 'lib/stripe/services/setup_intent_service.rb', line 1286

def expand
  @expand
end

#flow_directionsObject

Indicates the directions of money movement for which this payment method is intended to be used.

Include ‘inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.



1290
1291
1292
# File 'lib/stripe/services/setup_intent_service.rb', line 1290

def flow_directions
  @flow_directions
end

#mandate_dataObject

This hash contains details about the mandate to create. This parameter can only be used with [‘confirm=true`](stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).



1292
1293
1294
# File 'lib/stripe/services/setup_intent_service.rb', line 1292

def mandate_data
  @mandate_data
end

#metadataObject

Set of [key-value pairs](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`.



1294
1295
1296
# File 'lib/stripe/services/setup_intent_service.rb', line 1294

def 
  @metadata
end

#on_behalf_ofObject

The Stripe account ID created for this SetupIntent.



1296
1297
1298
# File 'lib/stripe/services/setup_intent_service.rb', line 1296

def on_behalf_of
  @on_behalf_of
end

#payment_methodObject

ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.



1298
1299
1300
# File 'lib/stripe/services/setup_intent_service.rb', line 1298

def payment_method
  @payment_method
end

#payment_method_configurationObject

The ID of the [payment method configuration](stripe.com/docs/api/payment_method_configurations) to use with this SetupIntent.



1300
1301
1302
# File 'lib/stripe/services/setup_intent_service.rb', line 1300

def payment_method_configuration
  @payment_method_configuration
end

#payment_method_dataObject

When included, this hash creates a PaymentMethod that is set as the [‘payment_method`](stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent.



1303
1304
1305
# File 'lib/stripe/services/setup_intent_service.rb', line 1303

def payment_method_data
  @payment_method_data
end

#payment_method_optionsObject

Payment method-specific configuration for this SetupIntent.



1305
1306
1307
# File 'lib/stripe/services/setup_intent_service.rb', line 1305

def payment_method_options
  @payment_method_options
end

#payment_method_typesObject

The list of payment method types (for example, card) that this SetupIntent can use. If you don’t provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](docs.stripe.com/api/payment_methods/object#payment_method_object-type).



1307
1308
1309
# File 'lib/stripe/services/setup_intent_service.rb', line 1307

def payment_method_types
  @payment_method_types
end

#return_urlObject

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [‘confirm=true`](stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).



1309
1310
1311
# File 'lib/stripe/services/setup_intent_service.rb', line 1309

def return_url
  @return_url
end

#single_useObject

If you populate this hash, this SetupIntent generates a ‘single_use` mandate after successful completion.

Single-use mandates are only valid for the following payment methods: ‘acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`.



1313
1314
1315
# File 'lib/stripe/services/setup_intent_service.rb', line 1313

def single_use
  @single_use
end

#usageObject

Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to ‘off_session`.



1315
1316
1317
# File 'lib/stripe/services/setup_intent_service.rb', line 1315

def usage
  @usage
end

#use_stripe_sdkObject

Set to ‘true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.



1317
1318
1319
# File 'lib/stripe/services/setup_intent_service.rb', line 1317

def use_stripe_sdk
  @use_stripe_sdk
end