Class: Stripe::ChargeCreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::ChargeCreateParams
- Defined in:
- lib/stripe/params/charge_create_params.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](docs.stripe.com/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](docs.stripe.com/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) ⇒ ChargeCreateParams
constructor
A new instance of ChargeCreateParams.
Methods inherited from RequestParams
attr_accessor, coerce_params, coerce_value, field_encodings, new, #to_h
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) ⇒ ChargeCreateParams
Returns a new instance of ChargeCreateParams.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/stripe/params/charge_create_params.rb', line 133 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](docs.stripe.com/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](docs.stripe.com/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).
93 94 95 |
# File 'lib/stripe/params/charge_create_params.rb', line 93 def amount @amount end |
#application_fee ⇒ Object
Attribute for param field application_fee
95 96 97 |
# File 'lib/stripe/params/charge_create_params.rb', line 95 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](docs.stripe.com/connect/direct-charges#collect-fees).
97 98 99 |
# File 'lib/stripe/params/charge_create_params.rb', line 97 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](api.stripe.com#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](docs.stripe.com/charges/placing-a-hold) documentation.
99 100 101 |
# File 'lib/stripe/params/charge_create_params.rb', line 99 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).
101 102 103 |
# File 'lib/stripe/params/charge_create_params.rb', line 101 def currency @currency end |
#customer ⇒ Object
The ID of an existing customer that will be charged in this request.
103 104 105 |
# File 'lib/stripe/params/charge_create_params.rb', line 103 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.
105 106 107 |
# File 'lib/stripe/params/charge_create_params.rb', line 105 def description @description end |
#destination ⇒ Object
Attribute for param field destination
107 108 109 |
# File 'lib/stripe/params/charge_create_params.rb', line 107 def destination @destination end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
109 110 111 |
# File 'lib/stripe/params/charge_create_params.rb', line 109 def @expand end |
#metadata ⇒ Object
Set of [key-value pairs](docs.stripe.com/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`.
111 112 113 |
# File 'lib/stripe/params/charge_create_params.rb', line 111 def @metadata end |
#on_behalf_of ⇒ Object
The Stripe account ID for which these funds are intended. You can specify the business of record as the connected account using the ‘on_behalf_of` attribute on the charge. For details, see [Creating Separate Charges and Transfers](docs.stripe.com/connect/separate-charges-and-transfers#settlement-merchant).
113 114 115 |
# File 'lib/stripe/params/charge_create_params.rb', line 113 def on_behalf_of @on_behalf_of end |
#radar_options ⇒ Object
Options to configure Radar. See [Radar Session](docs.stripe.com/radar/radar-session) for more information.
115 116 117 |
# File 'lib/stripe/params/charge_create_params.rb', line 115 def @radar_options end |
#receipt_email ⇒ Object
The email address to which this charge’s [receipt](docs.stripe.com/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](docs.stripe.com/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).
117 118 119 |
# File 'lib/stripe/params/charge_create_params.rb', line 117 def receipt_email @receipt_email end |
#shipping ⇒ Object
Shipping information for the charge. Helps prevent fraud on charges for physical goods.
119 120 121 |
# File 'lib/stripe/params/charge_create_params.rb', line 119 def shipping @shipping end |
#source ⇒ Object
A payment source to be charged. This can be the ID of a [card](docs.stripe.com/api#cards) (i.e., credit or debit card), a [bank account](docs.stripe.com/api#bank_accounts), a [source](docs.stripe.com/api#sources), a [token](docs.stripe.com/api#tokens), or a [connected account](docs.stripe.com/connect/account-debits#charging-a-connected-account). For certain sources—namely, [cards](docs.stripe.com/api#cards), [bank accounts](docs.stripe.com/api#bank_accounts), and attached [sources](docs.stripe.com/api#sources)—you must also pass the ID of the associated customer.
121 122 123 |
# File 'lib/stripe/params/charge_create_params.rb', line 121 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.
125 126 127 |
# File 'lib/stripe/params/charge_create_params.rb', line 125 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.
127 128 129 |
# File 'lib/stripe/params/charge_create_params.rb', line 127 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](docs.stripe.com/connect/destination-charges) for details.
129 130 131 |
# File 'lib/stripe/params/charge_create_params.rb', line 129 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](docs.stripe.com/connect/separate-charges-and-transfers#transfer-options).
131 132 133 |
# File 'lib/stripe/params/charge_create_params.rb', line 131 def transfer_group @transfer_group end |