Class: OnlinePayments::SDK::Domain::CreateHostedCheckoutResponse

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#hosted_checkout_idString

Returns the current value of hosted_checkout_id.

Returns:

  • (String)

    the current value of hosted_checkout_id



15
16
17
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 15

def hosted_checkout_id
  @hosted_checkout_id
end

#invalid_tokensArray<String>

Returns the current value of invalid_tokens.

Returns:

  • (Array<String>)

    the current value of invalid_tokens



15
16
17
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 15

def invalid_tokens
  @invalid_tokens
end

#merchant_referenceString

Returns the current value of merchant_reference.

Returns:

  • (String)

    the current value of merchant_reference



15
16
17
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 15

def merchant_reference
  @merchant_reference
end

#partial_redirect_urlString

Returns the current value of partial_redirect_url.

Returns:

  • (String)

    the current value of partial_redirect_url



15
16
17
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 15

def partial_redirect_url
  @partial_redirect_url
end

#redirect_urlString

Returns the current value of redirect_url.

Returns:

  • (String)

    the current value of redirect_url



15
16
17
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 15

def redirect_url
  @redirect_url
end

#returnmacString

Returns the current value of returnmac.

Returns:

  • (String)

    the current value of returnmac



15
16
17
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 15

def returnmac
  @returnmac
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 35

def from_hash(hash)
  super
  @returnmac = hash['RETURNMAC'] if hash.key? 'RETURNMAC'
  @hosted_checkout_id = hash['hostedCheckoutId'] if hash.key? 'hostedCheckoutId'
  if hash.key? 'invalidTokens'
    raise TypeError, "value '%s' is not an Array" % [hash['invalidTokens']] unless hash['invalidTokens'].is_a? Array
    @invalid_tokens = []
    hash['invalidTokens'].each do |e|
      @invalid_tokens << e
    end
  end
  @merchant_reference = hash['merchantReference'] if hash.key? 'merchantReference'
  @partial_redirect_url = hash['partialRedirectUrl'] if hash.key? 'partialRedirectUrl'
  @redirect_url = hash['redirectUrl'] if hash.key? 'redirectUrl'
end

#to_hHash

Returns:

  • (Hash)


24
25
26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb', line 24

def to_h
  hash = super
  hash['RETURNMAC'] = @returnmac unless @returnmac.nil?
  hash['hostedCheckoutId'] = @hosted_checkout_id unless @hosted_checkout_id.nil?
  hash['invalidTokens'] = @invalid_tokens unless @invalid_tokens.nil?
  hash['merchantReference'] = @merchant_reference unless @merchant_reference.nil?
  hash['partialRedirectUrl'] = @partial_redirect_url unless @partial_redirect_url.nil?
  hash['redirectUrl'] = @redirect_url unless @redirect_url.nil?
  hash
end