@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
60 lines (57 loc) • 2.42 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/refunds.ts
var Refunds = class _Refunds extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "refunds";
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _Refunds.TYPE }, params, options);
}
async order(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "orders" }, `refunds/${_refundId}/order`, params, options);
}
async attachments(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "attachments" }, `refunds/${_refundId}/attachments`, params, options);
}
async events(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "events" }, `refunds/${_refundId}/events`, params, options);
}
async versions(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "versions" }, `refunds/${_refundId}/versions`, params, options);
}
async event_stores(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "event_stores" }, `refunds/${_refundId}/event_stores`, params, options);
}
async reference_capture(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "captures" }, `refunds/${_refundId}/reference_capture`, params, options);
}
async return(refundId, params, options) {
const _refundId = refundId.id || refundId;
return this.resources.fetch({ type: "returns" }, `refunds/${_refundId}/return`, params, options);
}
async _forward(id, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _Refunds.TYPE, _forward: true }, params, options);
}
isRefund(resource) {
return resource.type && resource.type === _Refunds.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _Refunds.TYPE;
}
};
var instance = new Refunds();
var refunds_default = instance;
exports.refunds_default = refunds_default;
//# sourceMappingURL=chunk-IALPF4NG.cjs.map
//# sourceMappingURL=chunk-IALPF4NG.cjs.map
;