UNPKG

@commercelayer/sdk

Version:
56 lines (53 loc) 2.72 kB
'use strict'; var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs'); // src/resources/checkout_com_gateways.ts var CheckoutComGateways = class _CheckoutComGateways extends chunkVRRJS3ZM_cjs.ApiResource { static TYPE = "checkout_com_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _CheckoutComGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _CheckoutComGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _CheckoutComGateways.TYPE } : id, options); } async payment_methods(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "payment_methods" }, `checkout_com_gateways/${_checkoutComGatewayId}/payment_methods`, params, options); } async event_stores(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "event_stores" }, `checkout_com_gateways/${_checkoutComGatewayId}/event_stores`, params, options); } async checkout_com_payments(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "checkout_com_payments" }, `checkout_com_gateways/${_checkoutComGatewayId}/checkout_com_payments`, params, options); } async _disable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _CheckoutComGateways.TYPE, _disable: true }, params, options); } async _enable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _CheckoutComGateways.TYPE, _enable: true }, params, options); } async _check(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _CheckoutComGateways.TYPE, _check: true }, params, options); } isCheckoutComGateway(resource) { return resource.type && resource.type === _CheckoutComGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _CheckoutComGateways.TYPE; } }; var instance = new CheckoutComGateways(); var checkout_com_gateways_default = instance; exports.checkout_com_gateways_default = checkout_com_gateways_default; //# sourceMappingURL=chunk-T3OBEDI4.cjs.map //# sourceMappingURL=chunk-T3OBEDI4.cjs.map