Class: ActiveMerchant::Billing::PaymentToken

Inherits:
Object
  • Object
show all
Defined in:
lib/active_merchant/billing/payment_token.rb

Overview

Base class representation of cryptographic payment data tokens that may be used for EMV-style transactions like Apple Pay. Payment data may be transmitted via any data type, and may also be padded with metadata specific to the cryptographer. This metadata should be parsed and interpreted in concrete implementations of your given cryptographer. Like credit cards, you must also return a string representing the token’s type, like ‘apple_pay’ or ‘stripe’ should your target payment gateway process these tokens.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payment_data, options = {}) ⇒ PaymentToken

Returns a new instance of PaymentToken.



11
12
13
14
# File 'lib/active_merchant/billing/payment_token.rb', line 11

def initialize(payment_data, options = {})
  @payment_data = payment_data
   = options.with_indifferent_access
end

Instance Attribute Details

#payment_dataObject (readonly)

Returns the value of attribute payment_data.



9
10
11
# File 'lib/active_merchant/billing/payment_token.rb', line 9

def payment_data
  @payment_data
end

Instance Method Details

#typeObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/active_merchant/billing/payment_token.rb', line 16

def type
  raise NotImplementedError
end