UNPKG

@commercelayer/sdk

Version:
51 lines (48 loc) 2.22 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/stripe_gateways.ts var StripeGateways = class _StripeGateways extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "stripe_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _StripeGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _StripeGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _StripeGateways.TYPE } : id, options); } async payment_methods(stripeGatewayId, params, options) { const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId; return this.resources.fetch({ type: "payment_methods" }, `stripe_gateways/${_stripeGatewayId}/payment_methods`, params, options); } async versions(stripeGatewayId, params, options) { const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId; return this.resources.fetch({ type: "versions" }, `stripe_gateways/${_stripeGatewayId}/versions`, params, options); } async event_stores(stripeGatewayId, params, options) { const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId; return this.resources.fetch({ type: "event_stores" }, `stripe_gateways/${_stripeGatewayId}/event_stores`, params, options); } async stripe_payments(stripeGatewayId, params, options) { const _stripeGatewayId = stripeGatewayId.id || stripeGatewayId; return this.resources.fetch({ type: "stripe_payments" }, `stripe_gateways/${_stripeGatewayId}/stripe_payments`, params, options); } isStripeGateway(resource) { return resource.type && resource.type === _StripeGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _StripeGateways.TYPE; } }; var instance = new StripeGateways(); var stripe_gateways_default = instance; exports.stripe_gateways_default = stripe_gateways_default; //# sourceMappingURL=chunk-73VR2FML.cjs.map //# sourceMappingURL=chunk-73VR2FML.cjs.map