Class: OnlinePayments::SDK::Domain::PaymentProduct840SpecificOutput

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#billing_addressOnlinePayments::SDK::Domain::Address

Returns the current value of billing_address.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def billing_address
  @billing_address
end

#billing_personal_addressOnlinePayments::SDK::Domain::AddressPersonal

Returns the current value of billing_personal_address.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def billing_personal_address
  @billing_personal_address
end

#customer_accountOnlinePayments::SDK::Domain::PaymentProduct840CustomerAccount

Returns the current value of customer_account.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def 
  @customer_account
end

#customer_addressOnlinePayments::SDK::Domain::Address

Returns the current value of customer_address.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def customer_address
  @customer_address
end

#pay_pal_transaction_idString

Returns the current value of pay_pal_transaction_id.

Returns:

  • (String)

    the current value of pay_pal_transaction_id



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def pay_pal_transaction_id
  @pay_pal_transaction_id
end

#protection_eligibilityOnlinePayments::SDK::Domain::ProtectionEligibility

Returns the current value of protection_eligibility.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def protection_eligibility
  @protection_eligibility
end

#shipping_addressOnlinePayments::SDK::Domain::AddressPersonal

Returns the current value of shipping_address.

Returns:



20
21
22
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 20

def shipping_address
  @shipping_address
end

Instance Method Details

#from_hash(hash) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 49

def from_hash(hash)
  super
  if hash.has_key? 'billingAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['billingAddress']] unless hash['billingAddress'].is_a? Hash
    @billing_address = OnlinePayments::SDK::Domain::Address.new_from_hash(hash['billingAddress'])
  end
  if hash.has_key? 'billingPersonalAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['billingPersonalAddress']] unless hash['billingPersonalAddress'].is_a? Hash
    @billing_personal_address = OnlinePayments::SDK::Domain::AddressPersonal.new_from_hash(hash['billingPersonalAddress'])
  end
  if hash.has_key? 'customerAccount'
    raise TypeError, "value '%s' is not a Hash" % [hash['customerAccount']] unless hash['customerAccount'].is_a? Hash
    @customer_account = OnlinePayments::SDK::Domain::PaymentProduct840CustomerAccount.new_from_hash(hash['customerAccount'])
  end
  if hash.has_key? 'customerAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['customerAddress']] unless hash['customerAddress'].is_a? Hash
    @customer_address = OnlinePayments::SDK::Domain::Address.new_from_hash(hash['customerAddress'])
  end
  if hash.has_key? 'payPalTransactionId'
    @pay_pal_transaction_id = hash['payPalTransactionId']
  end
  if hash.has_key? 'protectionEligibility'
    raise TypeError, "value '%s' is not a Hash" % [hash['protectionEligibility']] unless hash['protectionEligibility'].is_a? Hash
    @protection_eligibility = OnlinePayments::SDK::Domain::ProtectionEligibility.new_from_hash(hash['protectionEligibility'])
  end
  if hash.has_key? 'shippingAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['shippingAddress']] unless hash['shippingAddress'].is_a? Hash
    @shipping_address = OnlinePayments::SDK::Domain::AddressPersonal.new_from_hash(hash['shippingAddress'])
  end
end

#to_hHash

Returns:

  • (Hash)


37
38
39
40
41
42
43
44
45
46
47
# File 'lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb', line 37

def to_h
  hash = super
  hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil?
  hash['billingPersonalAddress'] = @billing_personal_address.to_h unless @billing_personal_address.nil?
  hash['customerAccount'] = @customer_account.to_h unless @customer_account.nil?
  hash['customerAddress'] = @customer_address.to_h unless @customer_address.nil?
  hash['payPalTransactionId'] = @pay_pal_transaction_id unless @pay_pal_transaction_id.nil?
  hash['protectionEligibility'] = @protection_eligibility.to_h unless @protection_eligibility.nil?
  hash['shippingAddress'] = @shipping_address.to_h unless @shipping_address.nil?
  hash
end