UNPKG

@hyperse/paypal-node-sdk

Version:

NodeJS SDK for PayPal Checkout APIs

36 lines (35 loc) 1.39 kB
import querystring from 'querystring'; import { HttpRequestBase } from '../core/HttpRequestBase.js'; import {} from '../types/type-payment.js'; /** * Authorizations Reauthorize * @see {@link https://developer.paypal.com/api/payments/v2/#authorizations_reauthorize} */ export class AuthorizationsReauthorizeRequest extends HttpRequestBase { constructor(authorizationId) { super(); this.path = '/v2/payments/authorizations/{authorization_id}/reauthorize?'; this.path = this.path.replace('{authorization_id}', querystring.escape(authorizationId)); this.verb = 'POST'; this.headers = { 'Content-Type': 'application/json', }; } payPalRequestId(payPalRequestId) { this.headers['PayPal-Request-Id'] = payPalRequestId; return this; } /** * 1. return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links. * 2. return=representation. The server returns a complete resource representation, including the current state of the resource. * @default `return=minimal` */ prefer(prefer) { this.headers['Prefer'] = prefer; return this; } requestBody(reauthorizeRequest) { this.body = reauthorizeRequest; return this; } }