UNPKG

@commercelayer/sdk

Version:
54 lines (51 loc) 2.45 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/satispay_payments.ts var SatispayPayments = class _SatispayPayments extends chunkU22VLCMN_cjs.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; exports.satispay_payments_default = satispay_payments_default; //# sourceMappingURL=chunk-7SJAVPZH.cjs.map //# sourceMappingURL=chunk-7SJAVPZH.cjs.map