Class: PCPServerSDK::Models::ApplePayPayment

Inherits:
Object
  • Object
show all
Defined in:
lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb

Constant Summary collapse

JSON_PROPERTY_TOKEN =
'token'.freeze
JSON_PROPERTY_BILLING_CONTACT =
'billingContact'.freeze
JSON_PROPERTY_SHIPPING_CONTACT =
'shippingContact'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token = nil, billing_contact = nil, shipping_contact = nil) ⇒ ApplePayPayment

Returns a new instance of ApplePayPayment.



13
14
15
16
17
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 13

def initialize(token = nil, billing_contact = nil, shipping_contact = nil)
  @token = token
  @billing_contact = billing_contact
  @shipping_contact = shipping_contact
end

Instance Attribute Details

#billing_contactObject



7
8
9
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 7

def billing_contact
  @billing_contact
end

#shipping_contactObject



7
8
9
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 7

def shipping_contact
  @shipping_contact
end

#tokenObject



7
8
9
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 7

def token
  @token
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



31
32
33
34
35
36
37
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 31

def ==(other)
  return true if self.equal?(other)
  return false unless other.is_a?(ApplePayPayment)
  token == other.token &&
    billing_contact == other.billing_contact &&
    shipping_contact == other.shipping_contact
end

#hashObject



41
42
43
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 41

def hash
  [token, billing_contact, shipping_contact].hash
end

#to_sObject



45
46
47
48
49
50
51
# File 'lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment.rb', line 45

def to_s
  "class ApplePayPayment {\n" \
    "    token: #{to_indented_string(token)}\n" \
    "    billingContact: #{to_indented_string(billing_contact)}\n" \
    "    shippingContact: #{to_indented_string(shipping_contact)}\n" \
  "}"
end