UNPKG

@commercelayer/sdk

Version:
57 lines (54 loc) 2.56 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/stripe_payments.ts var StripePayments = class _StripePayments extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "stripe_payments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _StripePayments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _StripePayments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _StripePayments.TYPE } : id, options); } async order(stripePaymentId, params, options) { const _stripePaymentId = stripePaymentId.id || stripePaymentId; return this.resources.fetch({ type: "orders" }, `stripe_payments/${_stripePaymentId}/order`, params, options); } async payment_gateway(stripePaymentId, params, options) { const _stripePaymentId = stripePaymentId.id || stripePaymentId; return this.resources.fetch({ type: "payment_gateways" }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options); } async versions(stripePaymentId, params, options) { const _stripePaymentId = stripePaymentId.id || stripePaymentId; return this.resources.fetch({ type: "versions" }, `stripe_payments/${_stripePaymentId}/versions`, params, options); } async event_stores(stripePaymentId, params, options) { const _stripePaymentId = stripePaymentId.id || stripePaymentId; return this.resources.fetch({ type: "event_stores" }, `stripe_payments/${_stripePaymentId}/event_stores`, params, options); } async _update(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _StripePayments.TYPE, _update: true }, params, options); } async _refresh(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _StripePayments.TYPE, _refresh: true }, params, options); } isStripePayment(resource) { return resource.type && resource.type === _StripePayments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _StripePayments.TYPE; } }; var instance = new StripePayments(); var stripe_payments_default = instance; exports.stripe_payments_default = stripe_payments_default; //# sourceMappingURL=chunk-J32Z2XNX.cjs.map //# sourceMappingURL=chunk-J32Z2XNX.cjs.map