zohobooks-sdk
Version:
SDK for ZohoBooks integration
30 lines (29 loc) • 865 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Payments = void 0;
const endpoints_1 = require("../../constants/endpoints");
const api_client_1 = require("common/api-client");
class Payments extends api_client_1.ApiClient {
constructor(baseApi) {
super(baseApi, endpoints_1.EndPoint.CUSTOMER_PAYMENTS);
}
create(data) {
return this.api.post("/", data);
}
list() {
return this.api.get("/");
}
get(paymentId) {
return this.api.get(`/${paymentId}`);
}
update(paymentId, data) {
return this.api.put(`/${paymentId}`, data);
}
delete(paymentId) {
return this.api.delete(`/${paymentId}`);
}
refund(paymentId, amount, date) {
return this.api.post(`/${paymentId}/refunds`, { amount, date });
}
}
exports.Payments = Payments;