UNPKG

@commercelayer/sdk

Version:
58 lines (56 loc) 2.64 kB
import { ApiResource } from './chunk-XKERR6OR.js'; // src/resources/adyen_payments.ts var AdyenPayments = class _AdyenPayments extends ApiResource { static TYPE = "adyen_payments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _AdyenPayments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _AdyenPayments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _AdyenPayments.TYPE } : id, options); } async order(adyenPaymentId, params, options) { const _adyenPaymentId = adyenPaymentId.id || adyenPaymentId; return this.resources.fetch({ type: "orders" }, `adyen_payments/${_adyenPaymentId}/order`, params, options); } async payment_gateway(adyenPaymentId, params, options) { const _adyenPaymentId = adyenPaymentId.id || adyenPaymentId; return this.resources.fetch({ type: "payment_gateways" }, `adyen_payments/${_adyenPaymentId}/payment_gateway`, params, options); } async versions(adyenPaymentId, params, options) { const _adyenPaymentId = adyenPaymentId.id || adyenPaymentId; return this.resources.fetch({ type: "versions" }, `adyen_payments/${_adyenPaymentId}/versions`, params, options); } async event_stores(adyenPaymentId, params, options) { const _adyenPaymentId = adyenPaymentId.id || adyenPaymentId; return this.resources.fetch({ type: "event_stores" }, `adyen_payments/${_adyenPaymentId}/event_stores`, params, options); } async _authorize(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenPayments.TYPE, _authorize: true }, params, options); } async _details(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenPayments.TYPE, _details: true }, params, options); } async _balance(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenPayments.TYPE, _balance: true }, params, options); } isAdyenPayment(resource) { return resource.type && resource.type === _AdyenPayments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _AdyenPayments.TYPE; } }; var instance = new AdyenPayments(); var adyen_payments_default = instance; export { adyen_payments_default }; //# sourceMappingURL=chunk-GRBPCPJQ.js.map //# sourceMappingURL=chunk-GRBPCPJQ.js.map