Class: Mobilepay::Client
- Inherits:
-
Object
- Object
- Mobilepay::Client
- Includes:
- HTTParty, CancelReservation, CaptureAmount, PaymentStatus, PaymentTransactions, RefundAmount, Reservations, Requests, Requests::GenerateSignature
- Defined in:
- lib/mobilepay/client.rb,
lib/mobilepay/client/reservations.rb,
lib/mobilepay/client/refund_amount.rb,
lib/mobilepay/client/capture_amount.rb,
lib/mobilepay/client/payment_status.rb,
lib/mobilepay/client/cancel_reservation.rb,
lib/mobilepay/client/payment_transactions.rb
Overview
Clients requests
Defined Under Namespace
Modules: CancelReservation, CaptureAmount, PaymentStatus, PaymentTransactions, RefundAmount, Reservations
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#merchant_id ⇒ Object
readonly
Returns the value of attribute merchant_id.
-
#privatekey ⇒ Object
readonly
Returns the value of attribute privatekey.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Requests::GenerateSignature
Methods included from CancelReservation
Methods included from CaptureAmount
Methods included from RefundAmount
Methods included from Reservations
Methods included from PaymentTransactions
Methods included from PaymentStatus
Constructor Details
#initialize(args = {}) ⇒ Client
Returns a new instance of Client.
29 30 31 32 33 34 35 |
# File 'lib/mobilepay/client.rb', line 29 def initialize(args = {}) @privatekey = args[:privatekey] @headers = { 'Ocp-Apim-Subscription-Key' => args[:subscription_key], 'Content-Type' => 'application/json' } @merchant_id = args[:merchant_id] headers['Test-mode'] = 'true' if args[:test_mode] == true @body = '' end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
27 28 29 |
# File 'lib/mobilepay/client.rb', line 27 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
27 28 29 |
# File 'lib/mobilepay/client.rb', line 27 def headers @headers end |
#merchant_id ⇒ Object (readonly)
Returns the value of attribute merchant_id.
27 28 29 |
# File 'lib/mobilepay/client.rb', line 27 def merchant_id @merchant_id end |
#privatekey ⇒ Object (readonly)
Returns the value of attribute privatekey.
27 28 29 |
# File 'lib/mobilepay/client.rb', line 27 def privatekey @privatekey end |