Class: PayPal::AdaptivePayments::Response::Pay

Inherits:
Object
  • Object
show all
Includes:
Common::Response
Defined in:
lib/paypal/adaptive_payments/response/pay.rb

Instance Attribute Summary collapse

Attributes included from Common::Response

#error, #response_envelope

Instance Method Summary collapse

Methods included from Common::Response

#set_error, #set_response_envelope, #success?, #valid?

Methods included from Common::Base

#after_initialize, #build_datetime, #build_value, #camelize, #hash_keys, #initialize, #request, #to_hash, #to_json, #underscore

Instance Attribute Details

#default_funding_planObject

Returns the value of attribute default_funding_plan.



8
9
10
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 8

def default_funding_plan
  @default_funding_plan
end

#pay_error_listObject

Returns the value of attribute pay_error_list.



6
7
8
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 6

def pay_error_list
  @pay_error_list
end

#pay_keyObject

Returns the value of attribute pay_key.



5
6
7
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 5

def pay_key
  @pay_key
end

#payment_exec_statusObject

Returns the value of attribute payment_exec_status.



7
8
9
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 7

def payment_exec_status
  @payment_exec_status
end

#warning_data_listObject

Returns the value of attribute warning_data_list.



9
10
11
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 9

def warning_data_list
  @warning_data_list
end

Instance Method Details

#completed?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 27

def completed?
  self.payment_exec_status == 'COMPLETED'
end

#errorsObject



19
20
21
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 19

def errors
  super + pay_errors
end

#pay_errorsObject



15
16
17
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 15

def pay_errors
  (self.pay_error_list && self.pay_error_list.errors) || []
end

#payment_urlObject



23
24
25
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 23

def payment_url
  "#{PayPal::Api.site_endpoint}?cmd=_ap-payment&paykey=#{self.pay_key}"
end

#set_pay_error_list(value) ⇒ Object



11
12
13
# File 'lib/paypal/adaptive_payments/response/pay.rb', line 11

def set_pay_error_list(value)
  self.pay_error_list = build_value(PayErrorList, value)
end