Class: Paystack::Resources::Split

Inherits:
BaseResource show all
Defined in:
lib/paystack/resources/split.rb

Instance Method Summary collapse

Methods inherited from BaseResource

new

Instance Method Details

#add_subaccount(id, body = {}) ⇒ Object

Add Subaccount to Split POST /split/id/subaccount/add



10
11
12
# File 'lib/paystack/resources/split.rb', line 10

def add_subaccount(id, body = {})
  @transport.post("/split/#{id}/subaccount/add", body: body)
end

#create(body = {}) ⇒ Object

Create Split POST /split



17
18
19
# File 'lib/paystack/resources/split.rb', line 17

def create(body = {})
  @transport.post("/split", body: body)
end

#fetch(id) ⇒ Object

Fetch Split GET /split/id



24
25
26
# File 'lib/paystack/resources/split.rb', line 24

def fetch(id)
  @transport.get("/split/#{id}")
end

#list(query = {}) ⇒ Object

List Splits GET /split



31
32
33
# File 'lib/paystack/resources/split.rb', line 31

def list(query = {})
  @transport.get("/split", query: query)
end

#remove_subaccount(id, body = {}) ⇒ Object

Remove Subaccount from split POST /split/id/subaccount/remove



38
39
40
# File 'lib/paystack/resources/split.rb', line 38

def remove_subaccount(id, body = {})
  @transport.post("/split/#{id}/subaccount/remove", body: body)
end

#update(id, body = {}) ⇒ Object

Update Split PUT /split/id



45
46
47
# File 'lib/paystack/resources/split.rb', line 45

def update(id, body = {})
  @transport.put("/split/#{id}", body: body)
end