Class: AdaptivePay::PaymentRequest

Inherits:
AbstractPaymentRequest show all
Defined in:
lib/adaptive_pay/payment_request.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractPaymentRequest

#sender

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Request

attribute, attribute_names, #format_attribute, #perform, #read_attribute, #serialize, #write_attribute

Constructor Details

#initialize(&block) ⇒ PaymentRequest

Returns a new instance of PaymentRequest.



22
23
24
25
# File 'lib/adaptive_pay/payment_request.rb', line 22

def initialize(&block)
  @recipients = []
  super
end

Instance Attribute Details

#recipientsObject (readonly)

Returns the value of attribute recipients.



12
13
14
# File 'lib/adaptive_pay/payment_request.rb', line 12

def recipients
  @recipients
end

Class Method Details

.endpointObject



8
9
10
# File 'lib/adaptive_pay/payment_request.rb', line 8

def self.endpoint
  "Pay"
end

.response_typeObject



4
5
6
# File 'lib/adaptive_pay/payment_request.rb', line 4

def self.response_type
  :payment
end

Instance Method Details

#add_recipient(recipient_options) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/adaptive_pay/payment_request.rb', line 27

def add_recipient(recipient_options)
  if recipient_options.is_a?(AdaptivePay::Recipient)
    @recipients << recipient_options
  else
    @recipients << AdaptivePay::Recipient.new(recipient_options)
  end
end