Class: PaymentService

PaymentService

new PaymentService()

Creates a new PaymentService. Generally you should never create a PAYMILL service on your own. Instead use the exported "payments".
Source:

Methods

create(token, client, cb) → {Promise}

Create a Payment with a token.
Parameters:
Name Type Argument Description
token string the payment token, generated by the PAYMILL bridge.
client string | Client <optional>
the identifier of a client or a client.
cb Object <optional>
a callback.
Source:
Returns:
a promise, which will be fulfilled with a Payment or rejected with a PMError.
Type
Promise

detail(obj, cb) → {Promise}

Get a Payment.
Parameters:
Name Type Argument Description
obj string | Payment a payment object or its id. note, if you set a payment 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 Payment or rejected with a PMError.
Type
Promise

list(count, offset, filter, order, cb) → {Promise}

List Payments.
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 Payment.Filter | null <optional>
a list filter or null.
order Payment.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 Payment.
Parameters:
Name Type Argument Description
obj Payment a payment object or its id.
cb Object <optional>
a callback.
Source:
Returns:
a promise, which will be fulfilled with a Payment or rejected with a PMError.
Type
Promise