@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
56 lines (53 loc) • 2.48 kB
JavaScript
;
var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs');
// src/resources/adyen_gateways.ts
var AdyenGateways = class _AdyenGateways extends chunkVRRJS3ZM_cjs.ApiResource {
static TYPE = "adyen_gateways";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _AdyenGateways.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _AdyenGateways.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _AdyenGateways.TYPE } : id, options);
}
async payment_methods(adyenGatewayId, params, options) {
const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
return this.resources.fetch({ type: "payment_methods" }, `adyen_gateways/${_adyenGatewayId}/payment_methods`, params, options);
}
async event_stores(adyenGatewayId, params, options) {
const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
return this.resources.fetch({ type: "event_stores" }, `adyen_gateways/${_adyenGatewayId}/event_stores`, params, options);
}
async adyen_payments(adyenGatewayId, params, options) {
const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId;
return this.resources.fetch({ type: "adyen_payments" }, `adyen_gateways/${_adyenGatewayId}/adyen_payments`, params, options);
}
async _disable(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenGateways.TYPE, _disable: true }, params, options);
}
async _enable(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenGateways.TYPE, _enable: true }, params, options);
}
async _check(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenGateways.TYPE, _check: true }, params, options);
}
isAdyenGateway(resource) {
return resource.type && resource.type === _AdyenGateways.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _AdyenGateways.TYPE;
}
};
var instance = new AdyenGateways();
var adyen_gateways_default = instance;
exports.adyen_gateways_default = adyen_gateways_default;
//# sourceMappingURL=chunk-FUT3LCHP.cjs.map
//# sourceMappingURL=chunk-FUT3LCHP.cjs.map