Class: Stripe::Issuing::TransactionCreateUnlinkedRefundParams

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

Defined Under Namespace

Classes: MerchantData, 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(amount: nil, card: nil, currency: nil, expand: nil, merchant_data: nil, purchase_details: nil) ⇒ TransactionCreateUnlinkedRefundParams

Returns a new instance of TransactionCreateUnlinkedRefundParams.



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 387

def initialize(
  amount: nil,
  card: nil,
  currency: nil,
  expand: nil,
  merchant_data: nil,
  purchase_details: nil
)
  @amount = amount
  @card = card
  @currency = currency
  @expand = expand
  @merchant_data = merchant_data
  @purchase_details = purchase_details
end

Instance Attribute Details

#amountObject

The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal).



375
376
377
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 375

def amount
  @amount
end

#cardObject

Card associated with this unlinked refund transaction.



377
378
379
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 377

def card
  @card
end

#currencyObject

The currency of the unlinked refund. If not provided, defaults to the currency of the card. Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



379
380
381
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 379

def currency
  @currency
end

#expandObject

Specifies which fields in the response should be expanded.



381
382
383
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 381

def expand
  @expand
end

#merchant_dataObject

Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened.



383
384
385
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 383

def merchant_data
  @merchant_data
end

#purchase_detailsObject

Additional purchase information that is optionally provided by the merchant.



385
386
387
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 385

def purchase_details
  @purchase_details
end

Class Method Details

.field_encodingsObject



403
404
405
406
407
408
409
410
411
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
# File 'lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb', line 403

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