Class: PaysonAPI::Request::Payment
- Inherits:
-
Object
- Object
- PaysonAPI::Request::Payment
- Defined in:
- lib/payson_api/request/payment.rb
Instance Attribute Summary collapse
-
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#custom ⇒ Object
Returns the value of attribute custom.
-
#fees_payer ⇒ Object
Returns the value of attribute fees_payer.
-
#fundings ⇒ Object
Returns the value of attribute fundings.
-
#guarantee_offered ⇒ Object
Returns the value of attribute guarantee_offered.
-
#invoice_fee ⇒ Object
Returns the value of attribute invoice_fee.
-
#ipn_url ⇒ Object
Returns the value of attribute ipn_url.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#order_items ⇒ Object
Returns the value of attribute order_items.
-
#receivers ⇒ Object
Returns the value of attribute receivers.
-
#return_url ⇒ Object
Returns the value of attribute return_url.
-
#sender ⇒ Object
Returns the value of attribute sender.
-
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
Instance Method Summary collapse
-
#initialize(return_url, cancel_url, ipn_url, memo, sender, receivers, custom = nil) ⇒ Payment
constructor
A new instance of Payment.
- #to_hash ⇒ Object
Constructor Details
#initialize(return_url, cancel_url, ipn_url, memo, sender, receivers, custom = nil) ⇒ Payment
Returns a new instance of Payment.
8 9 10 11 12 13 14 15 16 |
# File 'lib/payson_api/request/payment.rb', line 8 def initialize(return_url, cancel_url, ipn_url, memo, sender, receivers, custom = nil) @return_url = return_url @cancel_url = cancel_url @ipn_url = ipn_url @memo = memo @sender = sender @receivers = receivers @custom = custom end |
Instance Attribute Details
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def cancel_url @cancel_url end |
#currency ⇒ Object
Returns the value of attribute currency.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def currency @currency end |
#custom ⇒ Object
Returns the value of attribute custom.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def custom @custom end |
#fees_payer ⇒ Object
Returns the value of attribute fees_payer.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def fees_payer @fees_payer end |
#fundings ⇒ Object
Returns the value of attribute fundings.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def fundings @fundings end |
#guarantee_offered ⇒ Object
Returns the value of attribute guarantee_offered.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def guarantee_offered @guarantee_offered end |
#invoice_fee ⇒ Object
Returns the value of attribute invoice_fee.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def invoice_fee @invoice_fee end |
#ipn_url ⇒ Object
Returns the value of attribute ipn_url.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def ipn_url @ipn_url end |
#locale ⇒ Object
Returns the value of attribute locale.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def locale @locale end |
#memo ⇒ Object
Returns the value of attribute memo.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def memo @memo end |
#order_items ⇒ Object
Returns the value of attribute order_items.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def order_items @order_items end |
#receivers ⇒ Object
Returns the value of attribute receivers.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def receivers @receivers end |
#return_url ⇒ Object
Returns the value of attribute return_url.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def return_url @return_url end |
#sender ⇒ Object
Returns the value of attribute sender.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def sender @sender end |
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
4 5 6 |
# File 'lib/payson_api/request/payment.rb', line 4 def tracking_id @tracking_id end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/payson_api/request/payment.rb', line 18 def to_hash {}.tap do |hash| # Append mandatory params hash['returnUrl'] = @return_url hash['cancelUrl'] = @cancel_url hash['memo'] = @memo hash.merge!(@sender.to_hash) hash.merge!(Receiver.to_hash(@receivers)) # Append optional params append_locale(hash, @locale) if @locale append_currency(hash, @currency) if @currency append_fees_payer(hash, @fees_payer) if @fees_payer append_guarantee(hash, @guarantee_offered) if @guarantee_offered hash.merge!(OrderItem.to_hash(@order_items)) if @order_items hash.merge!(Funding.to_hash(@fundings)) if @fundings hash['ipnNotificationUrl'] = @ipn_url if @ipn_url hash['invoiceFee'] = @invoice_fee if @invoice_fee hash['trackingId'] = @tracking_id if @tracking_id hash['custom'] = @custom if @custom end end |