Class: Portage::Ucp::PaymentMethodRef

Inherits:
Data
  • Object
show all
Defined in:
lib/portage/ucp/value_objects.rb

Overview

Portage extension (app.portage-ucp.payment_method) — an opaque PSP-issued reference only, never a raw PAN or the payment_token itself (§9/§16).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, psp_reference:, brand: nil, last4: nil, expires_at: nil, created_at: nil) ⇒ PaymentMethodRef

Returns a new instance of PaymentMethodRef.



579
# File 'lib/portage/ucp/value_objects.rb', line 579

def initialize(id:, psp_reference:, brand: nil, last4: nil, expires_at: nil, created_at: nil) = super

Instance Attribute Details

#brand ⇒ Object (readonly)

Returns the value of attribute brand

Returns:

  • (Object) —

    the current value of brand



578
579
580
# File 'lib/portage/ucp/value_objects.rb', line 578

def brand
  @brand
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at

Returns:

  • (Object) —

    the current value of created_at



578
579
580
# File 'lib/portage/ucp/value_objects.rb', line 578

def created_at
  @created_at
end

#expires_at ⇒ Object (readonly)

Returns the value of attribute expires_at

Returns:

  • (Object) —

    the current value of expires_at



578
579
580
# File 'lib/portage/ucp/value_objects.rb', line 578

def expires_at
  @expires_at
end

#id ⇒ Object (readonly)

Returns the value of attribute id

Returns:

  • (Object) —

    the current value of id



578
579
580
# File 'lib/portage/ucp/value_objects.rb', line 578

def id
  @id
end

#last4 ⇒ Object (readonly)

Returns the value of attribute last4

Returns:

  • (Object) —

    the current value of last4



578
579
580
# File 'lib/portage/ucp/value_objects.rb', line 578

def last4
  @last4
end

#psp_reference ⇒ Object (readonly)

Returns the value of attribute psp_reference

Returns:

  • (Object) —

    the current value of psp_reference



578
579
580
# File 'lib/portage/ucp/value_objects.rb', line 578

def psp_reference
  @psp_reference
end

Instance Method Details

#to_wire_h ⇒ Object



581
582
583
584
# File 'lib/portage/ucp/value_objects.rb', line 581

def to_wire_h
  { "id" => id, "psp_reference" => psp_reference, "brand" => brand, "last4" => last4,
    "expires_at" => expires_at, "created_at" => created_at }.compact
end