Class: Mobilepay::Client

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Requests::GenerateSignature

#generate_signature

Methods included from CancelReservation

#cancel_reservation

Methods included from CaptureAmount

#capture_amount

Methods included from RefundAmount

#refund_amount

Methods included from Reservations

#reservations

Methods included from PaymentTransactions

#payment_transactions

Methods included from PaymentStatus

#payment_status

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

#bodyObject (readonly)

Returns the value of attribute body.



27
28
29
# File 'lib/mobilepay/client.rb', line 27

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



27
28
29
# File 'lib/mobilepay/client.rb', line 27

def headers
  @headers
end

#merchant_idObject (readonly)

Returns the value of attribute merchant_id.



27
28
29
# File 'lib/mobilepay/client.rb', line 27

def merchant_id
  @merchant_id
end

#privatekeyObject (readonly)

Returns the value of attribute privatekey.



27
28
29
# File 'lib/mobilepay/client.rb', line 27

def privatekey
  @privatekey
end