Class: Worldline::Connect::SDK::V1::Domain::CapturePaymentShipping

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#addressWorldline::Connect::SDK::V1::Domain::AddressPersonal

Returns the current value of address.

Returns:



17
18
19
# File 'lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb', line 17

def address
  @address
end

#email_addressString

Returns the current value of email_address.

Returns:

  • (String)

    the current value of email_address



17
18
19
# File 'lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb', line 17

def email_address
  @email_address
end

#shipped_from_zipString

Returns the current value of shipped_from_zip.

Returns:

  • (String)

    the current value of shipped_from_zip



17
18
19
# File 'lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb', line 17

def shipped_from_zip
  @shipped_from_zip
end

#tracking_numberString

Returns the current value of tracking_number.

Returns:

  • (String)

    the current value of tracking_number



17
18
19
# File 'lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb', line 17

def tracking_number
  @tracking_number
end

Instance Method Details

#from_hash(hash) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb', line 37

def from_hash(hash)
  super
  if hash.has_key? 'address'
    raise TypeError, "value '%s' is not a Hash" % [hash['address']] unless hash['address'].is_a? Hash
    @address = Worldline::Connect::SDK::V1::Domain::AddressPersonal.new_from_hash(hash['address'])
  end
  if hash.has_key? 'emailAddress'
    @email_address = hash['emailAddress']
  end
  if hash.has_key? 'shippedFromZip'
    @shipped_from_zip = hash['shippedFromZip']
  end
  if hash.has_key? 'trackingNumber'
    @tracking_number = hash['trackingNumber']
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
# File 'lib/worldline/connect/sdk/v1/domain/capture_payment_shipping.rb', line 28

def to_h
  hash = super
  hash['address'] = @address.to_h unless @address.nil?
  hash['emailAddress'] = @email_address unless @email_address.nil?
  hash['shippedFromZip'] = @shipped_from_zip unless @shipped_from_zip.nil?
  hash['trackingNumber'] = @tracking_number unless @tracking_number.nil?
  hash
end