Class: Bitkassa::PaymentRequest
- Defined in:
- lib/bitkassa/payment_request.rb
Overview
Make a PaymentRequest.
This will return the payment-response whith all returned information. A payment-request consists of a payload containing the information for the payment and an authentication message, being a signed version of the payload.
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#description ⇒ Object
Returns the value of attribute description.
-
#meta_info ⇒ Object
Returns the value of attribute meta_info.
-
#return_url ⇒ Object
Returns the value of attribute return_url.
-
#update_url ⇒ Object
Returns the value of attribute update_url.
Instance Method Summary collapse
-
#attributes ⇒ Object
Attributes for the payload.
-
#can_perform? ⇒ Boolean
Override can_perform the require “currency” and “amount”.
-
#payload_action ⇒ Object
Payload action is “start_payment”.
Methods inherited from Request
Constructor Details
This class inherits a constructor from Bitkassa::Request
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
10 11 12 |
# File 'lib/bitkassa/payment_request.rb', line 10 def amount @amount end |
#currency ⇒ Object
Returns the value of attribute currency.
10 11 12 |
# File 'lib/bitkassa/payment_request.rb', line 10 def currency @currency end |
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/bitkassa/payment_request.rb', line 10 def description @description end |
#meta_info ⇒ Object
Returns the value of attribute meta_info.
10 11 12 |
# File 'lib/bitkassa/payment_request.rb', line 10 def end |
#return_url ⇒ Object
Returns the value of attribute return_url.
10 11 12 |
# File 'lib/bitkassa/payment_request.rb', line 10 def return_url @return_url end |
#update_url ⇒ Object
Returns the value of attribute update_url.
10 11 12 |
# File 'lib/bitkassa/payment_request.rb', line 10 def update_url @update_url end |
Instance Method Details
#attributes ⇒ Object
Attributes for the payload
-
attributesHash:
** currency String required. “EUR” or “BTC” ** amount Integer required, amount to be paid in cents or satoshis ** description, ** return_url, ** update_url, ** meta_info
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bitkassa/payment_request.rb', line 26 def attributes { currency: @currency, amount: @amount, description: @description, return_url: @return_url, update_url: @update_url, meta_info: } end |
#can_perform? ⇒ Boolean
Override can_perform the require “currency” and “amount”
39 40 41 42 43 |
# File 'lib/bitkassa/payment_request.rb', line 39 def can_perform? return false if currency.nil? return false if amount.nil? super end |
#payload_action ⇒ Object
Payload action is “start_payment”
47 48 49 |
# File 'lib/bitkassa/payment_request.rb', line 47 def payload_action "start_payment" end |