Class: Stripe::Issuing::Transaction

Inherits:
APIResource show all
Extended by:
APIOperations::List
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/issuing/transaction.rb

Overview

Any use of an [issued card](docs.stripe.com/issuing) that results in funds entering or leaving your Stripe account, such as a completed purchase or refund, is represented by an Issuing ‘Transaction` object.

Related guide: [Issued card transactions](docs.stripe.com/issuing/purchases/transactions)

Defined Under Namespace

Classes: AmountDetails, MerchantData, NetworkData, PurchaseDetails, Redaction, TestHelpers, Treasury

Constant Summary collapse

OBJECT_NAME =
"issuing.transaction"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#amountObject (readonly)

The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal).



421
422
423
# File 'lib/stripe/resources/issuing/transaction.rb', line 421

def amount
  @amount
end

#amount_detailsObject (readonly)

Detailed breakdown of amount components. These amounts are denominated in ‘currency` and in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal).



423
424
425
# File 'lib/stripe/resources/issuing/transaction.rb', line 423

def amount_details
  @amount_details
end

#authorizationObject (readonly)

The ‘Authorization` object that led to this transaction.



425
426
427
# File 'lib/stripe/resources/issuing/transaction.rb', line 425

def authorization
  @authorization
end

#balance_transactionObject (readonly)

ID of the [balance transaction](docs.stripe.com/api/balance_transactions) associated with this transaction.



427
428
429
# File 'lib/stripe/resources/issuing/transaction.rb', line 427

def balance_transaction
  @balance_transaction
end

#cardObject (readonly)

The card used to make this transaction.



429
430
431
# File 'lib/stripe/resources/issuing/transaction.rb', line 429

def card
  @card
end

#cardholderObject (readonly)

The cardholder to whom this transaction belongs.



431
432
433
# File 'lib/stripe/resources/issuing/transaction.rb', line 431

def cardholder
  @cardholder
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



433
434
435
# File 'lib/stripe/resources/issuing/transaction.rb', line 433

def created
  @created
end

#currencyObject (readonly)

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



435
436
437
# File 'lib/stripe/resources/issuing/transaction.rb', line 435

def currency
  @currency
end

#disputeObject (readonly)

If you’ve disputed the transaction, the ID of the dispute.



437
438
439
# File 'lib/stripe/resources/issuing/transaction.rb', line 437

def dispute
  @dispute
end

#idObject (readonly)

Unique identifier for the object.



439
440
441
# File 'lib/stripe/resources/issuing/transaction.rb', line 439

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



441
442
443
# File 'lib/stripe/resources/issuing/transaction.rb', line 441

def livemode
  @livemode
end

#merchant_amountObject (readonly)

The amount that the merchant will receive, denominated in ‘merchant_currency` and in the [smallest currency unit](docs.stripe.com/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency.



443
444
445
# File 'lib/stripe/resources/issuing/transaction.rb', line 443

def merchant_amount
  @merchant_amount
end

#merchant_currencyObject (readonly)

The currency with which the merchant is taking payment.



445
446
447
# File 'lib/stripe/resources/issuing/transaction.rb', line 445

def merchant_currency
  @merchant_currency
end

#merchant_dataObject (readonly)

Attribute for field merchant_data



447
448
449
# File 'lib/stripe/resources/issuing/transaction.rb', line 447

def merchant_data
  @merchant_data
end

#metadataObject (readonly)

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.



449
450
451
# File 'lib/stripe/resources/issuing/transaction.rb', line 449

def 
  @metadata
end

#network_dataObject (readonly)

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



451
452
453
# File 'lib/stripe/resources/issuing/transaction.rb', line 451

def network_data
  @network_data
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



453
454
455
# File 'lib/stripe/resources/issuing/transaction.rb', line 453

def object
  @object
end

#purchase_detailsObject (readonly)

Additional purchase information that is optionally provided by the merchant.



455
456
457
# File 'lib/stripe/resources/issuing/transaction.rb', line 455

def purchase_details
  @purchase_details
end

#redactionObject (readonly)

Redaction status of this transaction. If the transaction is not redacted, this field will be null.



457
458
459
# File 'lib/stripe/resources/issuing/transaction.rb', line 457

def redaction
  @redaction
end

#settlementObject (readonly)

The ID of the [settlement](docs.stripe.com/api/issuing/settlements) to which this transaction belongs.



459
460
461
# File 'lib/stripe/resources/issuing/transaction.rb', line 459

def settlement
  @settlement
end

#tokenObject (readonly)

[Token](docs.stripe.com/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.



461
462
463
# File 'lib/stripe/resources/issuing/transaction.rb', line 461

def token
  @token
end

#treasuryObject (readonly)

[Treasury](docs.stripe.com/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts



463
464
465
# File 'lib/stripe/resources/issuing/transaction.rb', line 463

def treasury
  @treasury
end

#typeObject (readonly)

The nature of the transaction.



465
466
467
# File 'lib/stripe/resources/issuing/transaction.rb', line 465

def type
  @type
end

#walletObject (readonly)

The digital wallet used for this transaction. One of ‘apple_pay`, `google_pay`, or `samsung_pay`.



467
468
469
# File 'lib/stripe/resources/issuing/transaction.rb', line 467

def wallet
  @wallet
end

Class Method Details

.field_encodingsObject



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/stripe/resources/issuing/transaction.rb', line 555

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 },
        },
      },
    },
  }
end

.field_remappingsObject



551
552
553
# File 'lib/stripe/resources/issuing/transaction.rb', line 551

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



540
541
542
543
544
545
546
547
548
549
# File 'lib/stripe/resources/issuing/transaction.rb', line 540

def self.inner_class_types
  @inner_class_types = {
    amount_details: AmountDetails,
    merchant_data: MerchantData,
    network_data: NetworkData,
    purchase_details: PurchaseDetails,
    redaction: Redaction,
    treasury: Treasury,
  }
end

.list(params = {}, opts = {}) ⇒ Object

Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.



470
471
472
473
474
475
476
477
# File 'lib/stripe/resources/issuing/transaction.rb', line 470

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/issuing/transactions",
    params: params,
    opts: opts
  )
end

.object_nameObject



16
17
18
# File 'lib/stripe/resources/issuing/transaction.rb', line 16

def self.object_name
  "issuing.transaction"
end

.update(transaction, params = {}, opts = {}) ⇒ Object

Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.



480
481
482
483
484
485
486
487
# File 'lib/stripe/resources/issuing/transaction.rb', line 480

def self.update(transaction, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/transactions/%<transaction>s", { transaction: CGI.escape(transaction) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#test_helpersObject



489
490
491
# File 'lib/stripe/resources/issuing/transaction.rb', line 489

def test_helpers
  TestHelpers.new(self)
end