@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
56 lines (53 loc) • 2.52 kB
JavaScript
;
var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs');
// src/resources/stripe_gateways.ts
var StripeGateways = class _StripeGateways extends chunkVRRJS3ZM_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 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);
}
async _disable(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _StripeGateways.TYPE, _disable: true }, params, options);
}
async _enable(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _StripeGateways.TYPE, _enable: true }, params, options);
}
async _check(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _StripeGateways.TYPE, _check: true }, 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-BPAVYFBD.cjs.map
//# sourceMappingURL=chunk-BPAVYFBD.cjs.map