Class: PayPal::AdaptivePayments::Payment
- Defined in:
- lib/paypal/adaptive_payments/payment.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action_type ⇒ Object
Returns the value of attribute action_type.
-
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
-
#client_details ⇒ Object
Returns the value of attribute client_details.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
-
#fees_payer ⇒ Object
Returns the value of attribute fees_payer.
-
#funding_constraint ⇒ Object
Returns the value of attribute funding_constraint.
-
#ipn_notification_url ⇒ Object
Returns the value of attribute ipn_notification_url.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#pay_key ⇒ Object
Returns the value of attribute pay_key.
-
#payment_info_list ⇒ Object
Returns the value of attribute payment_info_list.
-
#pin ⇒ Object
Returns the value of attribute pin.
-
#preapproval_key ⇒ Object
Returns the value of attribute preapproval_key.
-
#receiver_list ⇒ Object
Returns the value of attribute receiver_list.
-
#response ⇒ Object
Returns the value of attribute response.
-
#return_url ⇒ Object
Returns the value of attribute return_url.
-
#reverse_all_parallel_payments_on_error ⇒ Object
Returns the value of attribute reverse_all_parallel_payments_on_error.
-
#sender ⇒ Object
Returns the value of attribute sender.
-
#sender_email ⇒ Object
Returns the value of attribute sender_email.
-
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
Attributes inherited from Base
Instance Method Summary collapse
- #create ⇒ Object
- #details ⇒ Object
- #pay ⇒ Object
- #pay_primary ⇒ Object
- #payment_url ⇒ Object
- #receiver ⇒ Object
- #receiver=(receiver) ⇒ Object
- #refund ⇒ Object
- #run_execute ⇒ Object
- #run_pay ⇒ Object
- #set_funding_constraint(value) ⇒ Object
- #set_payment_info_list(value) ⇒ Object
- #set_receiver(value) ⇒ Object
- #set_sender(value) ⇒ Object
- #shipping_addresses ⇒ Object
Methods inherited from Base
Methods included from Common::Base
#after_initialize, #build_datetime, #build_value, #camelize, #hash_keys, #initialize, #request, #to_hash, #to_json, #underscore
Instance Attribute Details
#action_type ⇒ Object
Returns the value of attribute action_type.
4 5 6 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 4 def action_type @action_type end |
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
5 6 7 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 5 def cancel_url @cancel_url end |
#client_details ⇒ Object
Returns the value of attribute client_details.
6 7 8 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 6 def client_details @client_details end |
#currency_code ⇒ Object
Returns the value of attribute currency_code.
7 8 9 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 7 def currency_code @currency_code end |
#fees_payer ⇒ Object
Returns the value of attribute fees_payer.
8 9 10 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 8 def fees_payer @fees_payer end |
#funding_constraint ⇒ Object
Returns the value of attribute funding_constraint.
9 10 11 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 9 def funding_constraint @funding_constraint end |
#ipn_notification_url ⇒ Object
Returns the value of attribute ipn_notification_url.
10 11 12 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 10 def ipn_notification_url @ipn_notification_url end |
#memo ⇒ Object
Returns the value of attribute memo.
11 12 13 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 11 def memo @memo end |
#pay_key ⇒ Object
Returns the value of attribute pay_key.
12 13 14 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 12 def pay_key @pay_key end |
#payment_info_list ⇒ Object
Returns the value of attribute payment_info_list.
23 24 25 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 23 def payment_info_list @payment_info_list end |
#pin ⇒ Object
Returns the value of attribute pin.
13 14 15 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 13 def pin @pin end |
#preapproval_key ⇒ Object
Returns the value of attribute preapproval_key.
14 15 16 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 14 def preapproval_key @preapproval_key end |
#receiver_list ⇒ Object
Returns the value of attribute receiver_list.
15 16 17 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 15 def receiver_list @receiver_list end |
#response ⇒ Object
Returns the value of attribute response.
25 26 27 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 25 def response @response end |
#return_url ⇒ Object
Returns the value of attribute return_url.
16 17 18 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 16 def return_url @return_url end |
#reverse_all_parallel_payments_on_error ⇒ Object
Returns the value of attribute reverse_all_parallel_payments_on_error.
17 18 19 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 17 def reverse_all_parallel_payments_on_error @reverse_all_parallel_payments_on_error end |
#sender ⇒ Object
Returns the value of attribute sender.
18 19 20 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 18 def sender @sender end |
#sender_email ⇒ Object
Returns the value of attribute sender_email.
19 20 21 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 19 def sender_email @sender_email end |
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
20 21 22 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 20 def tracking_id @tracking_id end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
21 22 23 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 21 def transaction_id @transaction_id end |
Instance Method Details
#create ⇒ Object
44 45 46 47 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 44 def create self.action_type = 'CREATE' run_pay end |
#details ⇒ Object
63 64 65 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 63 def details Response.process(:payment_details, request.run(:payment_details, self.to_hash(:pay_key, :transaction_id, :tracking_id))) end |
#pay ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 49 def pay if self.pay_key run_execute else self.action_type = 'PAY' run_pay end end |
#pay_primary ⇒ Object
58 59 60 61 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 58 def pay_primary self.action_type = 'PAY_PRIMARY' run_pay end |
#payment_url ⇒ Object
85 86 87 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 85 def payment_url self.response && self.response.payment_url end |
#receiver ⇒ Object
36 37 38 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 36 def receiver self.receiver_list.first end |
#receiver=(receiver) ⇒ Object
32 33 34 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 32 def receiver=(receiver) self.receiver_list.only(receiver) end |
#refund ⇒ Object
71 72 73 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 71 def refund Response.process(:refund, request.run(:refund, self.to_hash)) end |
#run_execute ⇒ Object
75 76 77 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 75 def run_execute Response.process(:execute_payment, request.run(:execute_payment, self.to_hash(:pay_key))) end |
#run_pay ⇒ Object
79 80 81 82 83 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 79 def run_pay self.response = Response.process(:pay, request.run(:pay, self.to_hash)) self.pay_key = self.response.pay_key self.response end |
#set_funding_constraint(value) ⇒ Object
89 90 91 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 89 def set_funding_constraint(value) self.funding_constraint = build_value(FundingConstraint, value) end |
#set_payment_info_list(value) ⇒ Object
93 94 95 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 93 def set_payment_info_list(value) self.payment_info_list = build_value(PaymentInfoList, value) end |
#set_receiver(value) ⇒ Object
101 102 103 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 101 def set_receiver(value) self.receiver = build_value(Receiver, value) end |
#set_sender(value) ⇒ Object
97 98 99 |
# File 'lib/paypal/adaptive_payments/payment.rb', line 97 def set_sender(value) self.sender = build_value(SenderIdentifier, value) end |