Class: OnlinePayments::SDK::Domain::SubmitBatchRequestBody

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#cancel_paymentsArray<OnlinePayments::SDK::Domain::CancelPaymentBatchRequest>

Returns the current value of cancel_payments.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def cancel_payments
  @cancel_payments
end

#capture_paymentsArray<OnlinePayments::SDK::Domain::CapturePaymentBatchRequest>

Returns the current value of capture_payments.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def capture_payments
  @capture_payments
end

Returns the current value of create_payment_links.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def create_payment_links
  @create_payment_links
end

#create_paymentsArray<OnlinePayments::SDK::Domain::CreatePaymentRequest>

Returns the current value of create_payments.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def create_payments
  @create_payments
end

#create_payoutsArray<OnlinePayments::SDK::Domain::CreatePayoutRequest>

Returns the current value of create_payouts.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def create_payouts
  @create_payouts
end

#headerOnlinePayments::SDK::Domain::BatchMetadata

Returns the current value of header.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def header
  @header
end

#refund_paymentsArray<OnlinePayments::SDK::Domain::RefundPaymentBatchRequest>

Returns the current value of refund_payments.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def refund_payments
  @refund_payments
end

#subsequent_paymentsArray<OnlinePayments::SDK::Domain::SubsequentPaymentBatchRequest>

Returns the current value of subsequent_payments.

Returns:



25
26
27
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 25

def subsequent_payments
  @subsequent_payments
end

Instance Method Details

#from_hash(hash) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 57

def from_hash(hash)
  super
  if hash.has_key? 'cancelPayments'
    raise TypeError, "value '%s' is not an Array" % [hash['cancelPayments']] unless hash['cancelPayments'].is_a? Array
    @cancel_payments = []
    hash['cancelPayments'].each do |e|
      @cancel_payments << OnlinePayments::SDK::Domain::CancelPaymentBatchRequest.new_from_hash(e)
    end
  end
  if hash.has_key? 'capturePayments'
    raise TypeError, "value '%s' is not an Array" % [hash['capturePayments']] unless hash['capturePayments'].is_a? Array
    @capture_payments = []
    hash['capturePayments'].each do |e|
      @capture_payments << OnlinePayments::SDK::Domain::CapturePaymentBatchRequest.new_from_hash(e)
    end
  end
  if hash.has_key? 'createPaymentLinks'
    raise TypeError, "value '%s' is not an Array" % [hash['createPaymentLinks']] unless hash['createPaymentLinks'].is_a? Array
    @create_payment_links = []
    hash['createPaymentLinks'].each do |e|
      @create_payment_links << OnlinePayments::SDK::Domain::CreatePaymentLinkRequest.new_from_hash(e)
    end
  end
  if hash.has_key? 'createPayments'
    raise TypeError, "value '%s' is not an Array" % [hash['createPayments']] unless hash['createPayments'].is_a? Array
    @create_payments = []
    hash['createPayments'].each do |e|
      @create_payments << OnlinePayments::SDK::Domain::CreatePaymentRequest.new_from_hash(e)
    end
  end
  if hash.has_key? 'createPayouts'
    raise TypeError, "value '%s' is not an Array" % [hash['createPayouts']] unless hash['createPayouts'].is_a? Array
    @create_payouts = []
    hash['createPayouts'].each do |e|
      @create_payouts << OnlinePayments::SDK::Domain::CreatePayoutRequest.new_from_hash(e)
    end
  end
  if hash.has_key? 'header'
    raise TypeError, "value '%s' is not a Hash" % [hash['header']] unless hash['header'].is_a? Hash
    @header = OnlinePayments::SDK::Domain::BatchMetadata.new_from_hash(hash['header'])
  end
  if hash.has_key? 'refundPayments'
    raise TypeError, "value '%s' is not an Array" % [hash['refundPayments']] unless hash['refundPayments'].is_a? Array
    @refund_payments = []
    hash['refundPayments'].each do |e|
      @refund_payments << OnlinePayments::SDK::Domain::RefundPaymentBatchRequest.new_from_hash(e)
    end
  end
  if hash.has_key? 'subsequentPayments'
    raise TypeError, "value '%s' is not an Array" % [hash['subsequentPayments']] unless hash['subsequentPayments'].is_a? Array
    @subsequent_payments = []
    hash['subsequentPayments'].each do |e|
      @subsequent_payments << OnlinePayments::SDK::Domain::SubsequentPaymentBatchRequest.new_from_hash(e)
    end
  end
end

#to_hHash

Returns:

  • (Hash)


44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/onlinepayments/sdk/domain/submit_batch_request_body.rb', line 44

def to_h
  hash = super
  hash['cancelPayments'] = @cancel_payments.collect{|val| val.to_h} unless @cancel_payments.nil?
  hash['capturePayments'] = @capture_payments.collect{|val| val.to_h} unless @capture_payments.nil?
  hash['createPaymentLinks'] = @create_payment_links.collect{|val| val.to_h} unless @create_payment_links.nil?
  hash['createPayments'] = @create_payments.collect{|val| val.to_h} unless @create_payments.nil?
  hash['createPayouts'] = @create_payouts.collect{|val| val.to_h} unless @create_payouts.nil?
  hash['header'] = @header.to_h unless @header.nil?
  hash['refundPayments'] = @refund_payments.collect{|val| val.to_h} unless @refund_payments.nil?
  hash['subsequentPayments'] = @subsequent_payments.collect{|val| val.to_h} unless @subsequent_payments.nil?
  hash
end