Class: OnlinePayments::SDK::Domain::ApplePayRecurringPaymentRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#billing_agreementString

Returns the current value of billing_agreement.

Returns:

  • (String)

    the current value of billing_agreement



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

def billing_agreement
  @billing_agreement
end

#management_urlString

Returns the current value of management_url.

Returns:

  • (String)

    the current value of management_url



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

def management_url
  @management_url
end

#payment_descriptionString

Returns the current value of payment_description.

Returns:

  • (String)

    the current value of payment_description



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

def payment_description
  @payment_description
end

#regular_billingOnlinePayments::SDK::Domain::ApplePayLineItem

Returns the current value of regular_billing.

Returns:



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

def regular_billing
  @regular_billing
end

#trial_billingOnlinePayments::SDK::Domain::ApplePayLineItem

Returns the current value of trial_billing.

Returns:



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

def trial_billing
  @trial_billing
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/onlinepayments/sdk/domain/apple_pay_recurring_payment_request.rb', line 38

def from_hash(hash)
  super
  if hash.has_key? 'billingAgreement'
    @billing_agreement = hash['billingAgreement']
  end
  if hash.has_key? 'managementUrl'
    @management_url = hash['managementUrl']
  end
  if hash.has_key? 'paymentDescription'
    @payment_description = hash['paymentDescription']
  end
  if hash.has_key? 'regularBilling'
    raise TypeError, "value '%s' is not a Hash" % [hash['regularBilling']] unless hash['regularBilling'].is_a? Hash
    @regular_billing = OnlinePayments::SDK::Domain::ApplePayLineItem.new_from_hash(hash['regularBilling'])
  end
  if hash.has_key? 'trialBilling'
    raise TypeError, "value '%s' is not a Hash" % [hash['trialBilling']] unless hash['trialBilling'].is_a? Hash
    @trial_billing = OnlinePayments::SDK::Domain::ApplePayLineItem.new_from_hash(hash['trialBilling'])
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
36
# File 'lib/onlinepayments/sdk/domain/apple_pay_recurring_payment_request.rb', line 28

def to_h
  hash = super
  hash['billingAgreement'] = @billing_agreement unless @billing_agreement.nil?
  hash['managementUrl'] = @management_url unless @management_url.nil?
  hash['paymentDescription'] = @payment_description unless @payment_description.nil?
  hash['regularBilling'] = @regular_billing.to_h unless @regular_billing.nil?
  hash['trialBilling'] = @trial_billing.to_h unless @trial_billing.nil?
  hash
end