@hyperse/paypal-node-sdk
Version:
NodeJS SDK for PayPal Checkout APIs
24 lines (23 loc) • 865 B
JavaScript
import querystring from 'querystring';
import { HttpRequestBase } from '../core/HttpRequestBase.js';
import {} from '../types/type-order.js';
/**
* Updates an order. You can update an order with `CREATED` or `APPROVED` status.
* You cannot update an order with `COMPLETED` status. The following attributes and objects are patchable:
* @see {@link https://developer.paypal.com/api/orders/v2/#orders_patch}
*/
export class OrdersPatchRequest extends HttpRequestBase {
constructor(orderId) {
super();
this.path = '/v2/checkout/orders/{order_id}?';
this.path = this.path.replace('{order_id}', querystring.escape(orderId));
this.verb = 'PATCH';
this.headers = {
'Content-Type': 'application/json',
};
}
requestBody(patchRequest) {
this.body = patchRequest;
return this;
}
}