@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
49 lines (47 loc) • 2.15 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.js';
// src/resources/stripe_gateways.ts
var StripeGateways = class _StripeGateways extends 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;
export { stripe_gateways_default };
//# sourceMappingURL=chunk-3SD7QN5M.js.map
//# sourceMappingURL=chunk-3SD7QN5M.js.map