Class: Stripe::TestHelpers::Issuing::AuthorizationCaptureParams

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb

Defined Under Namespace

Classes: PurchaseDetails

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(capture_amount: nil, close_authorization: nil, expand: nil, purchase_details: nil) ⇒ AuthorizationCaptureParams

Returns a new instance of AuthorizationCaptureParams.



344
345
346
347
348
349
350
351
352
353
354
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 344

def initialize(
  capture_amount: nil,
  close_authorization: nil,
  expand: nil,
  purchase_details: nil
)
  @capture_amount = capture_amount
  @close_authorization = close_authorization
  @expand = expand
  @purchase_details = purchase_details
end

Instance Attribute Details

#capture_amountObject

The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal).



336
337
338
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 336

def capture_amount
  @capture_amount
end

#close_authorizationObject

Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows.



338
339
340
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 338

def close_authorization
  @close_authorization
end

#expandObject

Specifies which fields in the response should be expanded.



340
341
342
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 340

def expand
  @expand
end

#purchase_detailsObject

Additional purchase information that is optionally provided by the merchant.



342
343
344
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 342

def purchase_details
  @purchase_details
end

Class Method Details

.field_encodingsObject



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 356

def self.field_encodings
  @field_encodings = {
    purchase_details: {
      kind: :object,
      fields: {
        fleet: {
          kind: :object,
          fields: {
            reported_breakdown: {
              kind: :object,
              fields: {
                fuel: { kind: :object, fields: { gross_amount_decimal: :decimal_string } },
                non_fuel: { kind: :object, fields: { gross_amount_decimal: :decimal_string } },
                tax: {
                  kind: :object,
                  fields: {
                    local_amount_decimal: :decimal_string,
                    national_amount_decimal: :decimal_string,
                  },
                },
              },
            },
          },
        },
        fuel: {
          kind: :object,
          fields: { quantity_decimal: :decimal_string, unit_cost_decimal: :decimal_string },
        },
        receipt: {
          kind: :array,
          element: { kind: :object, fields: { quantity: :decimal_string } },
        },
      },
    },
  }
end