new PreauthorizationService()
Creates a new PreauthorizationService. Generally you should never create a PAYMILL service on your own. Instead use the exported "preauthorizations".
- Source:
Methods
-
createWithPayment(payment, amount, currency, description, cb) → {Promise}
-
Create a preauthorization with a payment object.
Parameters:
Name Type Argument Description paymentstring | Payment the payment object for the preauthorization or its id. amountstring | number amount (in cents) which will be charged. currencystring ISO 4217 formatted currency code. descriptionstring A short description for the preauthorization. cbObject <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Preauthorization or rejected with a PMError. The actual preauthorization is in the transaction member "preauthorization".- Type
- Promise
-
createWithToken(token, amount, currency, description, cb) → {Promise}
-
Create a preauthorization with a token.
Parameters:
Name Type Argument Description tokenstring the payment token, generated by the PAYMILL bridge. amountstring | number amount (in cents) which will be charged. currencystring ISO 4217 formatted currency code. descriptionstring A short description for the preauthorization. cbObject <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Preauthorization or rejected with a PMError. The actual preauthorization is in the transaction member "preauthorization".- Type
- Promise
-
detail(obj, cb) → {Promise}
-
Get a preauthorization.
Parameters:
Name Type Argument Description objstring | Preauthorization a preauthorization object or its id. note, if you set a preauthorization 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 Preauthorization or rejected with a PMError.- Type
- Promise
-
list(count, offset, filter, order, cb) → {Promise}
-
List preauthorizations.
Parameters:
Name Type Argument Description countstring | number <optional>
limit of objects to be listed. use for pagination. offsetstring | number <optional>
offset. use for pagination. filterPreauthorization.Filter | null <optional>
a list filter or null. orderPreauthorization.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 preauthorization.
Parameters:
Name Type Argument Description objPreauthorization a preauthorization object or its id. cbObject <optional>
a callback. - Source:
Returns:
a promise, which will be fulfilled with a Preauthorization or rejected with a PMError.- Type
- Promise