UNPKG

@commercelayer/sdk

Version:
54 lines (51 loc) 2.37 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/axerve_payments.ts var AxervePayments = class _AxervePayments extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "axerve_payments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _AxervePayments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _AxervePayments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _AxervePayments.TYPE } : id, options); } async order(axervePaymentId, params, options) { const _axervePaymentId = axervePaymentId.id || axervePaymentId; return this.resources.fetch({ type: "orders" }, `axerve_payments/${_axervePaymentId}/order`, params, options); } async payment_gateway(axervePaymentId, params, options) { const _axervePaymentId = axervePaymentId.id || axervePaymentId; return this.resources.fetch({ type: "payment_gateways" }, `axerve_payments/${_axervePaymentId}/payment_gateway`, params, options); } async versions(axervePaymentId, params, options) { const _axervePaymentId = axervePaymentId.id || axervePaymentId; return this.resources.fetch({ type: "versions" }, `axerve_payments/${_axervePaymentId}/versions`, params, options); } async event_stores(axervePaymentId, params, options) { const _axervePaymentId = axervePaymentId.id || axervePaymentId; return this.resources.fetch({ type: "event_stores" }, `axerve_payments/${_axervePaymentId}/event_stores`, params, options); } async _update(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AxervePayments.TYPE, _update: true }, params, options); } isAxervePayment(resource) { return resource.type && resource.type === _AxervePayments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _AxervePayments.TYPE; } }; var instance = new AxervePayments(); var axerve_payments_default = instance; exports.axerve_payments_default = axerve_payments_default; //# sourceMappingURL=chunk-P2OLPCWV.cjs.map //# sourceMappingURL=chunk-P2OLPCWV.cjs.map