PHP Classes

File: docs/CUSTOMER.md

Recommend this page to a friend!
  Classes of Ujah Chigozie peter   PHP Payment Gateway Library   docs/CUSTOMER.md   Download  
File: docs/CUSTOMER.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP Payment Gateway Library
Process payments with multiple gateways
Author: By
Last change:
Date: 5 months ago
Size: 1,314 bytes
 

Contents

Class file image Download

CUSTOMERS

If you are using getInstance then you must access the customer instance by using $merchant->customer-> else if you are working with getCustomerInstance you can directly call the customer class method.

Create customer account

$result = $customer->create([
    'metadata' => [=
        'key' => "Value"
    ],
    'first_name' => "Peter",
    'last_name' => "Foo",
    'phone' => "000000",
    'email' => "peter@example.com",
]);
if($result->isSuccess()){
//Do something
}

Update customer account

$result = $customer->update($customerCode, [
    'first_name' => "Peter",
    'last_name' => "Bar",
    'phone' => "1111111",
    'email' => "peter@example.com",
]);
if($result->isSuccess()){
//Do something
}

Flag customer accounts based on risk level Allowed flags PayStack::FLAG_DEFAULT, PayStack::FLAG_ALLOW, or PayStack::FLAG_DENY

$result = $customer->flag($customerCode, PayStack::FLAG_DENY);
if($result->isSuccess()){
//Do something
}

Verify customer account

$result = $customer->verify($customerCode, ['array']);
if($result->isSuccess()){
//Do something
}

List customers

$result = $customer->list($limit);

Find customer by email address or customer code

$result = $customer->find('CUS_jbf8bq0kbkrk3sc');