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 emailstring <optional>
email address of the client, is optional if the transaction creates an user itself. descriptionstring <optional>
description for the client. cbObject <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 objstring | Client a client object or its id. note, if you set a client object it will be updated, no new object will be created. cbObject <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 countstring | number <optional>
limit of objects to be listed. use for pagination. offsetstring | number <optional>
offset. use for pagination. filterClient.Filter | null <optional>
a list filter or null. orderClient.Order | null <optional>
a list order or null. cbObject <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 objClient a client object or its id. cbObject <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Client or rejected with a PMError.- Type
- Promise