Class: Paystack::Resources::Customer

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

Instance Method Summary collapse

Methods inherited from BaseResource

new

Instance Method Details

#create(body = {}) ⇒ Object

Create Customer POST /customer



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

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

#deactivate_authorization(body = {}) ⇒ Object

Deactivate Authorization POST /customer/authorization/deactivate



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

def deactivate_authorization(body = {})
  @transport.post("/customer/authorization/deactivate", body: body)
end

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

Direct Debit Activation Charge PUT /customer/id/directdebit-activation-charge



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

def direct_debit_activation_charge(id, body = {})
  @transport.put("/customer/#{id}/directdebit-activation-charge", body: body)
end

#fetch(code) ⇒ Object

Fetch Customer GET /customer/code



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

def fetch(code)
  @transport.get("/customer/#{code}")
end

#fetch_mandate_authorizations(id) ⇒ Object

Fetch Mandate Authorizations GET /customer/id/directdebit-mandate-authorizations



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

def fetch_mandate_authorizations(id)
  @transport.get("/customer/#{id}/directdebit-mandate-authorizations")
end

#initialize_authorization(body = {}) ⇒ Object

Initialize Authorization POST /customer/authorization/initialize



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

def initialize_authorization(body = {})
  @transport.post("/customer/authorization/initialize", body: body)
end

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

Initialize Direct Debit POST /customer/id/initialize-direct-debit



52
53
54
# File 'lib/paystack/resources/customer.rb', line 52

def initialize_direct_debit(id, body = {})
  @transport.post("/customer/#{id}/initialize-direct-debit", body: body)
end

#list(query = {}) ⇒ Object

List Customers GET /customer



59
60
61
# File 'lib/paystack/resources/customer.rb', line 59

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

#risk_action(body = {}) ⇒ Object

Set Risk Action POST /customer/set_risk_action



66
67
68
# File 'lib/paystack/resources/customer.rb', line 66

def risk_action(body = {})
  @transport.post("/customer/set_risk_action", body: body)
end

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

Update Customer PUT /customer/code



73
74
75
# File 'lib/paystack/resources/customer.rb', line 73

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

#validate(code, body = {}) ⇒ Object

Validate Customer POST /customer/code/identification



80
81
82
# File 'lib/paystack/resources/customer.rb', line 80

def validate(code, body = {})
  @transport.post("/customer/#{code}/identification", body: body)
end

#verify_authorization(reference) ⇒ Object

Verify Authorization GET /customer/authorization/verify/reference



87
88
89
# File 'lib/paystack/resources/customer.rb', line 87

def verify_authorization(reference)
  @transport.get("/customer/authorization/verify/#{reference}")
end