Skip to content

Instantly share code, notes, and snippets.

@kinsomicrote
Last active February 26, 2017 06:37
Show Gist options
  • Save kinsomicrote/3ba7b5249c743d08b4362a427c196950 to your computer and use it in GitHub Desktop.
Save kinsomicrote/3ba7b5249c743d08b4362a427c196950 to your computer and use it in GitHub Desktop.
require 'rest-client'
require 'json'
class Wave
def initialize(flutterwave_api_key, flutterwave_api_secret)
@url = "https://moneywave.herokuapp.com"
@flutterwave_api_key = flutterwave_api_key
@flutterwave_api_secret = flutterwave_api_secret
end
def options
{
"flutterwave_api_key": @flutterwave_api_key,
"flutterwave_api_secret": @flutterwave_api_secret
}
end
def headers(token)
{
:'Authorisation' => "#{token}"
}
end
def verify_merchant
response = RestClient.post("#{@url}/v1/merchant/verify", options)
@token = JSON.parse(response)["token"]
end
def get_banks
response = RestClient.post("#{@url}/banks", options, headers(@token))
@banks = JSON.parse(response)["data"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment