UNPKG

@commercelayer/sdk

Version:
52 lines (50 loc) 2.39 kB
import { ApiResource } from './chunk-XKERR6OR.js'; // src/resources/satispay_payments.ts var SatispayPayments = class _SatispayPayments extends ApiResource { static TYPE = "satispay_payments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _SatispayPayments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _SatispayPayments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _SatispayPayments.TYPE } : id, options); } async order(satispayPaymentId, params, options) { const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId; return this.resources.fetch({ type: "orders" }, `satispay_payments/${_satispayPaymentId}/order`, params, options); } async payment_gateway(satispayPaymentId, params, options) { const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId; return this.resources.fetch({ type: "payment_gateways" }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options); } async versions(satispayPaymentId, params, options) { const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId; return this.resources.fetch({ type: "versions" }, `satispay_payments/${_satispayPaymentId}/versions`, params, options); } async event_stores(satispayPaymentId, params, options) { const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId; return this.resources.fetch({ type: "event_stores" }, `satispay_payments/${_satispayPaymentId}/event_stores`, params, options); } async _refresh(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _SatispayPayments.TYPE, _refresh: true }, params, options); } isSatispayPayment(resource) { return resource.type && resource.type === _SatispayPayments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _SatispayPayments.TYPE; } }; var instance = new SatispayPayments(); var satispay_payments_default = instance; export { satispay_payments_default }; //# sourceMappingURL=chunk-ZXEE43XR.js.map //# sourceMappingURL=chunk-ZXEE43XR.js.map