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 tokenstring the payment token, generated by the PAYMILL bridge. clientstring | Client <optional>
the identifier of a client or a client. cbObject <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 objstring | Payment a payment object or its id. note, if you set a payment 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 Payment or rejected with a PMError.- Type
- Promise
-
list(count, offset, filter, order, cb) → {Promise}
-
List Payments.
Parameters:
Name Type Argument Description countstring | number <optional>
limit of objects to be listed. use for pagination. offsetstring | number <optional>
offset. use for pagination. filterPayment.Filter | null <optional>
a list filter or null. orderPayment.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 Payment.
Parameters:
Name Type Argument Description objPayment a payment object or its id. cbObject <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Payment or rejected with a PMError.- Type
- Promise