Create customer

Customer is used to group the various other objects, in order to provide a logical structure to the payment processes. Also, it is an essential object to create before some advanced capabilities can be attempted, like recurring or pay-per-use billing.

Create

None of the properties of Customer object are required, but if you specify at least email and description you will get a nicer overview in the Administration tool.

Use the fields of this object depending on your specific business needs.

$customerReq = Pencepay_Request_Customer::build()
    ->name('John Hancock')
    ->firstName('John')
    ->lastName('Hancock')
    ->email('some@email.com')
    ->phone('1122334455')
    ->mobile('1122334455')
    ->description('some description2')
    ->billingAddress()
    ->addressLine1('Street 123')
    ->city('zagreb')
    ->postalCode('10000')
    ->countryCode('HR')
    ->done()
    ->customData(array('my' => 'value'));

$customer = Pencepay_Customer::create($customerReq);

Result

Customer object is returned on success.