Class: Stripe::Charge::CreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Charge::CreateParams
- Defined in:
- lib/stripe/resources/charge.rb
Defined Under Namespace
Classes: Destination, RadarOptions, Shipping, TransferData
Instance Attribute Summary collapse
-
#amount ⇒ Object
Amount intended to be collected by this payment.
-
#application_fee ⇒ Object
Attribute for param field application_fee.
-
#application_fee_amount ⇒ Object
A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner’s Stripe account.
-
#capture ⇒ Object
Whether to immediately capture the charge.
-
#currency ⇒ Object
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#customer ⇒ Object
The ID of an existing customer that will be charged in this request.
-
#description ⇒ Object
An arbitrary string which you can attach to a ‘Charge` object.
-
#destination ⇒ Object
Attribute for param field destination.
-
#expand ⇒ Object
Specifies which fields in the response should be expanded.
-
#metadata ⇒ Object
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#on_behalf_of ⇒ Object
The Stripe account ID for which these funds are intended.
-
#radar_options ⇒ Object
Options to configure Radar.
-
#receipt_email ⇒ Object
The email address to which this charge’s [receipt](stripe.com/docs/dashboard/receipts) will be sent.
-
#shipping ⇒ Object
Shipping information for the charge.
-
#source ⇒ Object
A payment source to be charged.
-
#statement_descriptor ⇒ Object
For a non-card charge, text that appears on the customer’s statement as the statement descriptor.
-
#statement_descriptor_suffix ⇒ Object
Provides information about a card charge.
-
#transfer_data ⇒ Object
An optional dictionary including the account to automatically transfer to as part of a destination charge.
-
#transfer_group ⇒ Object
A string that identifies this transaction as part of a group.
Instance Method Summary collapse
-
#initialize(amount: nil, application_fee: nil, application_fee_amount: nil, capture: nil, currency: nil, customer: nil, description: nil, destination: nil, expand: nil, metadata: nil, on_behalf_of: nil, radar_options: nil, receipt_email: nil, shipping: nil, source: nil, statement_descriptor: nil, statement_descriptor_suffix: nil, transfer_data: nil, transfer_group: nil) ⇒ CreateParams
constructor
A new instance of CreateParams.
Methods inherited from RequestParams
Constructor Details
#initialize(amount: nil, application_fee: nil, application_fee_amount: nil, capture: nil, currency: nil, customer: nil, description: nil, destination: nil, expand: nil, metadata: nil, on_behalf_of: nil, radar_options: nil, receipt_email: nil, shipping: nil, source: nil, statement_descriptor: nil, statement_descriptor_suffix: nil, transfer_data: nil, transfer_group: nil) ⇒ CreateParams
Returns a new instance of CreateParams.
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 |
# File 'lib/stripe/resources/charge.rb', line 1445 def initialize( amount: nil, application_fee: nil, application_fee_amount: nil, capture: nil, currency: nil, customer: nil, description: nil, destination: nil, expand: nil, metadata: nil, on_behalf_of: nil, radar_options: nil, receipt_email: nil, shipping: nil, source: nil, statement_descriptor: nil, statement_descriptor_suffix: nil, transfer_data: nil, transfer_group: nil ) @amount = amount @application_fee = application_fee @application_fee_amount = application_fee_amount @capture = capture @currency = currency @customer = customer @description = description @destination = destination @expand = @metadata = @on_behalf_of = on_behalf_of @radar_options = @receipt_email = receipt_email @shipping = shipping @source = source @statement_descriptor = statement_descriptor @statement_descriptor_suffix = statement_descriptor_suffix @transfer_data = transfer_data @transfer_group = transfer_group end |
Instance Attribute Details
#amount ⇒ Object
Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
1405 1406 1407 |
# File 'lib/stripe/resources/charge.rb', line 1405 def amount @amount end |
#application_fee ⇒ Object
Attribute for param field application_fee
1407 1408 1409 |
# File 'lib/stripe/resources/charge.rb', line 1407 def application_fee @application_fee end |
#application_fee_amount ⇒ Object
A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the ‘Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](stripe.com/docs/connect/direct-charges#collect-fees).
1409 1410 1411 |
# File 'lib/stripe/resources/charge.rb', line 1409 def application_fee_amount @application_fee_amount end |
#capture ⇒ Object
Whether to immediately capture the charge. Defaults to ‘true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](stripe.com/docs/charges/placing-a-hold) documentation.
1411 1412 1413 |
# File 'lib/stripe/resources/charge.rb', line 1411 def capture @capture end |
#currency ⇒ Object
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
1413 1414 1415 |
# File 'lib/stripe/resources/charge.rb', line 1413 def currency @currency end |
#customer ⇒ Object
The ID of an existing customer that will be charged in this request.
1415 1416 1417 |
# File 'lib/stripe/resources/charge.rb', line 1415 def customer @customer end |
#description ⇒ Object
An arbitrary string which you can attach to a ‘Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing.
1417 1418 1419 |
# File 'lib/stripe/resources/charge.rb', line 1417 def description @description end |
#destination ⇒ Object
Attribute for param field destination
1419 1420 1421 |
# File 'lib/stripe/resources/charge.rb', line 1419 def destination @destination end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
1421 1422 1423 |
# File 'lib/stripe/resources/charge.rb', line 1421 def @expand end |
#metadata ⇒ Object
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`.
1423 1424 1425 |
# File 'lib/stripe/resources/charge.rb', line 1423 def @metadata end |
#on_behalf_of ⇒ Object
The Stripe account ID for which these funds are intended. Automatically set if you use the ‘destination` parameter. For details, see [Creating Separate Charges and Transfers](stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant).
1425 1426 1427 |
# File 'lib/stripe/resources/charge.rb', line 1425 def on_behalf_of @on_behalf_of end |
#radar_options ⇒ Object
Options to configure Radar. See [Radar Session](stripe.com/docs/radar/radar-session) for more information.
1427 1428 1429 |
# File 'lib/stripe/resources/charge.rb', line 1427 def @radar_options end |
#receipt_email ⇒ Object
The email address to which this charge’s [receipt](stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](stripe.com/docs/api/customers/object), the email address specified here will override the customer’s email address. If ‘receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](dashboard.stripe.com/account/emails).
1429 1430 1431 |
# File 'lib/stripe/resources/charge.rb', line 1429 def receipt_email @receipt_email end |
#shipping ⇒ Object
Shipping information for the charge. Helps prevent fraud on charges for physical goods.
1431 1432 1433 |
# File 'lib/stripe/resources/charge.rb', line 1431 def shipping @shipping end |
#source ⇒ Object
A payment source to be charged. This can be the ID of a [card](stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](stripe.com/docs/api#bank_accounts), a [source](stripe.com/docs/api#sources), a [token](stripe.com/docs/api#tokens), or a [connected account](stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources—namely, [cards](stripe.com/docs/api#cards), [bank accounts](stripe.com/docs/api#bank_accounts), and attached [sources](stripe.com/docs/api#sources)—you must also pass the ID of the associated customer.
1433 1434 1435 |
# File 'lib/stripe/resources/charge.rb', line 1433 def source @source end |
#statement_descriptor ⇒ Object
For a non-card charge, text that appears on the customer’s statement as the statement descriptor. This value overrides the account’s default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](docs.stripe.com/get-started/account/statement-descriptors).
For a card charge, this value is ignored unless you don’t specify a ‘statement_descriptor_suffix`, in which case this value is used as the suffix.
1437 1438 1439 |
# File 'lib/stripe/resources/charge.rb', line 1437 def statement_descriptor @statement_descriptor end |
#statement_descriptor_suffix ⇒ Object
Provides information about a card charge. Concatenated to the account’s [statement descriptor prefix](docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer’s statement. If the account has no prefix value, the suffix is concatenated to the account’s statement descriptor.
1439 1440 1441 |
# File 'lib/stripe/resources/charge.rb', line 1439 def statement_descriptor_suffix @statement_descriptor_suffix end |
#transfer_data ⇒ Object
An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](stripe.com/docs/connect/destination-charges) for details.
1441 1442 1443 |
# File 'lib/stripe/resources/charge.rb', line 1441 def transfer_data @transfer_data end |
#transfer_group ⇒ Object
A string that identifies this transaction as part of a group. For details, see [Grouping transactions](stripe.com/docs/connect/separate-charges-and-transfers#transfer-options).
1443 1444 1445 |
# File 'lib/stripe/resources/charge.rb', line 1443 def transfer_group @transfer_group end |