Class: VirtualAccountNumber

Inherits:
Base
  • Object
show all
Defined in:
lib/flutterwave_sdk/flutterwave_objects/virtual_account_number.rb

Instance Attribute Summary

Attributes inherited from Base

#flutterwave_object

Instance Method Summary collapse

Methods inherited from Base

#check_passed_parameters, #delete_request, #get_request, #initialize, #post_request, #put_request

Constructor Details

This class inherits a constructor from Base

Instance Method Details

#create_bulk_virtual_account_number(data) ⇒ Object



15
16
17
18
19
20
# File 'lib/flutterwave_sdk/flutterwave_objects/virtual_account_number.rb', line 15

def (data)
    base_url = flutterwave_object.base_url 
    payload = data.to_json
    response = post_request("#{base_url}/bulk-virtual-account-numbers", payload) 
    return response
end

#create_virtual_account_number(data) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/flutterwave_sdk/flutterwave_objects/virtual_account_number.rb', line 6

def (data)
    base_url = flutterwave_object.base_url 
    required_parameters = ["email", "duration", "frequency", "tx_ref"]
    check_passed_parameters(required_parameters, data)
    payload = data.to_json
    response = post_request("#{base_url}/virtual-account-numbers", payload) 
    return response
end

#get_bulk_virtual_account_number(batch_id) ⇒ Object



22
23
24
25
26
# File 'lib/flutterwave_sdk/flutterwave_objects/virtual_account_number.rb', line 22

def (batch_id)
    base_url = flutterwave_object.base_url 
    response = get_request("#{base_url}/bulk-virtual-account-numbers/#{batch_id}") 
    return response
end

#get_virtual_account_number(order_ref) ⇒ Object



28
29
30
31
32
# File 'lib/flutterwave_sdk/flutterwave_objects/virtual_account_number.rb', line 28

def (order_ref)
    base_url = flutterwave_object.base_url 
    response = get_request("#{base_url}/virtual-account-numbers/#{order_ref}") 
    return response
end