class MeoWallet::Client

Public Class Methods

new(secret) click to toggle source
# File lib/meo_wallet/client.rb, line 10
def initialize(secret)
  self.class.headers 'Authorization' => "WalletPT #{secret}"
end

Public Instance Methods

checkout_completed?(id) click to toggle source
# File lib/meo_wallet/client.rb, line 22
def checkout_completed?(id)
  get_checkout(id)['payment']['status'] == 'COMPLETED'
end
create_checkout(payment_data) click to toggle source
# File lib/meo_wallet/client.rb, line 14
def create_checkout(payment_data)
  self.class.post '/api/v2/checkout', body: payment_data.to_json
end
get_checkout(id) click to toggle source
# File lib/meo_wallet/client.rb, line 18
def get_checkout(id)
  self.class.get "/api/v2/checkout/#{id}"
end