@mft/moneyhub-api-client
Version:
Node.JS client for the Moneyhub API
36 lines • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = ({ config, request }) => {
const { identityServiceUrl } = config;
return {
getRecurringPayments: async (params = {}, options) => request(`${identityServiceUrl}/recurring-payments`, {
searchParams: params,
cc: {
scope: "recurring_payment:read",
},
options,
}),
getRecurringPayment: async ({ recurringPaymentId }, options) => request(`${identityServiceUrl}/recurring-payments/${recurringPaymentId}`, {
cc: {
scope: "recurring_payment:read",
},
options,
}),
makeRecurringPayment: async ({ recurringPaymentId, payment }, options) => request(`${identityServiceUrl}/recurring-payments/${recurringPaymentId}/pay`, {
method: "POST",
body: payment,
cc: {
scope: "recurring_payment:create",
},
options,
}),
revokeRecurringPayment: async ({ recurringPaymentId }, options) => request(`${identityServiceUrl}/recurring-payments/${recurringPaymentId}`, {
method: "DELETE",
cc: {
scope: "recurring_payment:create",
},
options,
}),
};
};
//# sourceMappingURL=recurring-payments.js.map