diff --git a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts index 7143b2f614..533046b957 100644 --- a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts @@ -76,7 +76,7 @@ async function getAccessToken(this: IHookFunctions | IExecuteFunctions | IExecut * Make an API request to paginated paypal endpoint * and return all results */ -export async function payPalApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, propertyName: string, endpoint: string, method: string, body: any = {}, query?: IDataObject, uri?: string): Promise { // tslint:disable-line:no-any +export async function paypalApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, propertyName: string, endpoint: string, method: string, body: any = {}, query?: IDataObject, uri?: string): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; @@ -85,7 +85,7 @@ export async function payPalApiRequestAllItems(this: IHookFunctions | IExecuteFu query!.page_size = 1000; do { - responseData = await payPalApiRequest.call(this, endpoint, method, body, query, uri); + responseData = await paypalApiRequest.call(this, endpoint, method, body, query, uri); uri = getNext(responseData.links); returnData.push.apply(returnData, responseData[propertyName]); } while ( diff --git a/packages/nodes-base/nodes/PayPal/PayPal.node.ts b/packages/nodes-base/nodes/PayPal/PayPal.node.ts index 9f664a46ee..8071525f74 100644 --- a/packages/nodes-base/nodes/PayPal/PayPal.node.ts +++ b/packages/nodes-base/nodes/PayPal/PayPal.node.ts @@ -22,8 +22,8 @@ import { } from './PaymentInteface'; import { validateJSON, - payPalApiRequest, - payPalApiRequestAllItems + paypalApiRequest, + paypalApiRequestAllItems } from './GenericFunctions'; export class PayPal implements INodeType { @@ -129,7 +129,7 @@ export class PayPal implements INodeType { body.items = itemsJson; } try { - responseData = await payPalApiRequest.call(this, '/payments/payouts', 'POST', body); + responseData = await paypalApiRequest.call(this, '/payments/payouts', 'POST', body); } catch (err) { throw new Error(`PayPal Error: ${JSON.stringify(err)}`); } @@ -139,10 +139,10 @@ export class PayPal implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0) as boolean; try { if (returnAll === true) { - responseData = await payPalApiRequestAllItems.call(this, 'items', `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs); + responseData = await paypalApiRequestAllItems.call(this, 'items', `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs); } else { qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await payPalApiRequest.call(this, `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs); + responseData = await paypalApiRequest.call(this, `/payments/payouts/${payoutBatchId}`, 'GET', {}, qs); responseData = responseData.items; } } catch (err) { @@ -153,7 +153,7 @@ export class PayPal implements INodeType { if (operation === 'get') { const payoutItemId = this.getNodeParameter('payoutItemId', i) as string; try { - responseData = await payPalApiRequest.call(this,`/payments/payouts-item/${payoutItemId}`, 'GET', {}, qs); + responseData = await paypalApiRequest.call(this,`/payments/payouts-item/${payoutItemId}`, 'GET', {}, qs); } catch (err) { throw new Error(`PayPal Error: ${JSON.stringify(err)}`); } @@ -161,7 +161,7 @@ export class PayPal implements INodeType { if (operation === 'cancel') { const payoutItemId = this.getNodeParameter('payoutItemId', i) as string; try { - responseData = await payPalApiRequest.call(this,`/payments/payouts-item/${payoutItemId}/cancel`, 'POST', {}, qs); + responseData = await paypalApiRequest.call(this,`/payments/payouts-item/${payoutItemId}/cancel`, 'POST', {}, qs); } catch (err) { throw new Error(`PayPal Error: ${JSON.stringify(err)}`); } diff --git a/packages/nodes-base/nodes/Paypal/PayPalTrigger.node.ts b/packages/nodes-base/nodes/Paypal/PayPalTrigger.node.ts index 6932f60fe8..baa07951b8 100644 --- a/packages/nodes-base/nodes/Paypal/PayPalTrigger.node.ts +++ b/packages/nodes-base/nodes/Paypal/PayPalTrigger.node.ts @@ -15,7 +15,6 @@ import { paypalApiRequest, upperFist } from './GenericFunctions'; -import { queryResult } from 'pg-promise'; export class PayPalTrigger implements INodeType { description: INodeTypeDescription = { diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 5500bf35ca..6e77260024 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -115,14 +115,9 @@ "dist/nodes/OpenWeatherMap.node.js", "dist/nodes/Pipedrive/Pipedrive.node.js", "dist/nodes/Pipedrive/PipedriveTrigger.node.js", -<<<<<<< HEAD - "dist/nodes/Postgres/Postgres.node.js", - "dist/nodes/Paypal/PayPal.node.js", - "dist/nodes/Paypal/PayPalTrigger.node.js", -======= "dist/nodes/Postgres/Postgres.node.js", "dist/nodes/PayPal/PayPal.node.js", ->>>>>>> master + "dist/nodes/PayPal/PayPalTrigger.node.js", "dist/nodes/Rocketchat/Rocketchat.node.js", "dist/nodes/ReadBinaryFile.node.js", "dist/nodes/ReadBinaryFiles.node.js",