@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
49 lines (47 loc) • 2.13 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.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 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;
export { paypal_payments_default };
//# sourceMappingURL=chunk-UEDVN7C4.js.map
//# sourceMappingURL=chunk-UEDVN7C4.js.map