UNPKG

@commercelayer/sdk

Version:
51 lines (48 loc) 2.19 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/paypal_payments.ts var PaypalPayments = class _PaypalPayments extends chunkU22VLCMN_cjs.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 versions(paypalPaymentId, params, options) { const _paypalPaymentId = paypalPaymentId.id || paypalPaymentId; return this.resources.fetch({ type: "versions" }, `paypal_payments/${_paypalPaymentId}/versions`, 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; exports.paypal_payments_default = paypal_payments_default; //# sourceMappingURL=chunk-PBIARBZH.cjs.map //# sourceMappingURL=chunk-PBIARBZH.cjs.map