UNPKG

@commercelayer/sdk

Version:
57 lines (54 loc) 2.77 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/checkout_com_payments.ts var CheckoutComPayments = class _CheckoutComPayments extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "checkout_com_payments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _CheckoutComPayments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _CheckoutComPayments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _CheckoutComPayments.TYPE } : id, options); } async order(checkoutComPaymentId, params, options) { const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId; return this.resources.fetch({ type: "orders" }, `checkout_com_payments/${_checkoutComPaymentId}/order`, params, options); } async payment_gateway(checkoutComPaymentId, params, options) { const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId; return this.resources.fetch({ type: "payment_gateways" }, `checkout_com_payments/${_checkoutComPaymentId}/payment_gateway`, params, options); } async versions(checkoutComPaymentId, params, options) { const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId; return this.resources.fetch({ type: "versions" }, `checkout_com_payments/${_checkoutComPaymentId}/versions`, params, options); } async event_stores(checkoutComPaymentId, params, options) { const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId; return this.resources.fetch({ type: "event_stores" }, `checkout_com_payments/${_checkoutComPaymentId}/event_stores`, params, options); } async _details(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _CheckoutComPayments.TYPE, _details: true }, params, options); } async _refresh(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _CheckoutComPayments.TYPE, _refresh: true }, params, options); } isCheckoutComPayment(resource) { return resource.type && resource.type === _CheckoutComPayments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _CheckoutComPayments.TYPE; } }; var instance = new CheckoutComPayments(); var checkout_com_payments_default = instance; exports.checkout_com_payments_default = checkout_com_payments_default; //# sourceMappingURL=chunk-Q3ULISRX.cjs.map //# sourceMappingURL=chunk-Q3ULISRX.cjs.map