new ClientService()
Creates a new ClientService. Generally you should never create a PAYMILL service on your own. Instead use the exported "clients".
- Source:
Methods
-
create(email, description, cb) → {Promise}
-
This function creates a client object.
Parameters:
Name Type Argument Description email
string <optional>
email address of the client, is optional if the transaction creates an user itself. description
string <optional>
description for the client. cb
Object <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Client or rejected with a PMError.- Type
- Promise
-
detail(obj, cb) → {Promise}
-
Get a Client.
Parameters:
Name Type Argument Description obj
string | Client a client object or its id. note, if you set a client object it will be updated, no new object will be created. cb
Object <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Client or rejected with a PMError.- Type
- Promise
-
list(count, offset, filter, order, cb) → {Promise}
-
List clients.
Parameters:
Name Type Argument Description count
string | number <optional>
limit of objects to be listed. use for pagination. offset
string | number <optional>
offset. use for pagination. filter
Client.Filter | null <optional>
a list filter or null. order
Client.Order | null <optional>
a list order or null. cb
Object <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a PayMillObjectList or rejected with a PMError.- Type
- Promise
-
remove(obj, cb) → {Promise}
-
Remove a Client.
Parameters:
Name Type Argument Description obj
Client a client object or its id. cb
Object <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Client or rejected with a PMError.- Type
- Promise