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: NetworkData, 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, network_data: nil, purchase_details: nil) ⇒ AuthorizationCaptureParams

Returns a new instance of AuthorizationCaptureParams.



398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 398

def initialize(
  capture_amount: nil,
  close_authorization: nil,
  expand: nil,
  network_data: nil,
  purchase_details: nil
)
  @capture_amount = capture_amount
  @close_authorization = close_authorization
  @expand = expand
  @network_data = network_data
  @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.



388
389
390
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 388

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.



390
391
392
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 390

def close_authorization
  @close_authorization
end

#expandObject

Specifies which fields in the response should be expanded.



392
393
394
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 392

def expand
  @expand
end

#network_dataObject

Details about the transaction, such as processing dates, set by the card network.



394
395
396
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 394

def network_data
  @network_data
end

#purchase_detailsObject

Additional purchase information that is optionally provided by the merchant.



396
397
398
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 396

def purchase_details
  @purchase_details
end

Class Method Details

.field_encodingsObject



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb', line 412

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