Last active
February 26, 2017 06:37
-
-
Save kinsomicrote/3ba7b5249c743d08b4362a427c196950 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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