mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
sync upstream
This commit is contained in:
@@ -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)}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user