UNPKG

@commercelayer/sdk

Version:
45 lines (43 loc) 1.88 kB
import { ApiResource } from './chunk-XDRKC6JM.js'; // src/resources/paypal_payments.ts var PaypalPayments = class _PaypalPayments extends ApiResource { static TYPE = "paypal_payments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _PaypalPayments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _PaypalPayments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _PaypalPayments.TYPE } : id, options); } async order(paypalPaymentId, params, options) { const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId; return this.resources.fetch({ type: "orders" }, `paypal_payments/${_paypalPaymentId}/order`, params, options); } async payment_gateway(paypalPaymentId, params, options) { const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId; return this.resources.fetch({ type: "payment_gateways" }, `paypal_payments/${_paypalPaymentId}/payment_gateway`, params, options); } async event_stores(paypalPaymentId, params, options) { const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId; return this.resources.fetch({ type: "event_stores" }, `paypal_payments/${_paypalPaymentId}/event_stores`, params, options); } isPaypalPayment(resource) { return resource.type && resource.type === _PaypalPayments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _PaypalPayments.TYPE; } }; var instance = new PaypalPayments(); var paypal_payments_default = instance; export { paypal_payments_default }; //# sourceMappingURL=chunk-67DYVCOK.js.map //# sourceMappingURL=chunk-67DYVCOK.js.map