Class: PaysonAPI::V1::Requests::Payment
- Inherits:
-
Object
- Object
- PaysonAPI::V1::Requests::Payment
- Defined in:
- lib/payson_api/v1/requests/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
-
#to_hash ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity.
Instance Attribute Details
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def cancel_url @cancel_url end |
#currency ⇒ Object
Returns the value of attribute currency.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def currency @currency end |
#custom ⇒ Object
Returns the value of attribute custom.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def custom @custom end |
#fees_payer ⇒ Object
Returns the value of attribute fees_payer.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def fees_payer @fees_payer end |
#fundings ⇒ Object
Returns the value of attribute fundings.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def fundings @fundings end |
#guarantee_offered ⇒ Object
Returns the value of attribute guarantee_offered.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def guarantee_offered @guarantee_offered end |
#invoice_fee ⇒ Object
Returns the value of attribute invoice_fee.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def invoice_fee @invoice_fee end |
#ipn_url ⇒ Object
Returns the value of attribute ipn_url.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def ipn_url @ipn_url end |
#locale ⇒ Object
Returns the value of attribute locale.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def locale @locale end |
#memo ⇒ Object
Returns the value of attribute memo.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def memo @memo end |
#order_items ⇒ Object
Returns the value of attribute order_items.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def order_items @order_items end |
#receivers ⇒ Object
Returns the value of attribute receivers.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def receivers @receivers end |
#return_url ⇒ Object
Returns the value of attribute return_url.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def return_url @return_url end |
#sender ⇒ Object
Returns the value of attribute sender.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def sender @sender end |
#tracking_id ⇒ Object
Returns the value of attribute tracking_id.
7 8 9 |
# File 'lib/payson_api/v1/requests/payment.rb', line 7 def tracking_id @tracking_id end |
Instance Method Details
#to_hash ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/payson_api/v1/requests/payment.rb', line 11 def to_hash # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity {}.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 |