mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 15:44:06 -08:00
fix(PayPal Trigger Node): Omit verification on sandbox env (#5150)
This commit is contained in:
parent
c9e158e458
commit
e140ecbc2c
|
@ -162,19 +162,28 @@ export class PayPalTrigger implements INodeType {
|
||||||
const headerData = this.getHeaderData() as IDataObject;
|
const headerData = this.getHeaderData() as IDataObject;
|
||||||
const endpoint = '/notifications/verify-webhook-signature';
|
const endpoint = '/notifications/verify-webhook-signature';
|
||||||
|
|
||||||
|
const { env } = (await this.getCredentials('payPalApi')) as { env: string };
|
||||||
|
|
||||||
|
// if sanbox omit verification
|
||||||
|
if (env === 'sanbox') {
|
||||||
|
return {
|
||||||
|
workflowData: [this.helpers.returnJsonArray(req.body)],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
headerData['PAYPAL-AUTH-ALGO'] !== undefined &&
|
headerData['paypal-auth-algo'] !== undefined &&
|
||||||
headerData['PAYPAL-CERT-URL'] !== undefined &&
|
headerData['paypal-cert-url'] !== undefined &&
|
||||||
headerData['PAYPAL-TRANSMISSION-ID'] !== undefined &&
|
headerData['paypal-transmission-id'] !== undefined &&
|
||||||
headerData['PAYPAL-TRANSMISSION-SIG'] !== undefined &&
|
headerData['paypal-transmission-sig'] !== undefined &&
|
||||||
headerData['PAYPAL-TRANSMISSION-TIME'] !== undefined
|
headerData['paypal-transmission-time'] !== undefined
|
||||||
) {
|
) {
|
||||||
const body = {
|
const body = {
|
||||||
auth_algo: headerData['PAYPAL-AUTH-ALGO'],
|
auth_algo: headerData['paypal-auth-algo'],
|
||||||
cert_url: headerData['PAYPAL-CERT-URL'],
|
cert_url: headerData['paypal-cert-url'],
|
||||||
transmission_id: headerData['PAYPAL-TRANSMISSION-ID'],
|
transmission_id: headerData['paypal-transmission-id'],
|
||||||
transmission_sig: headerData['PAYPAL-TRANSMISSION-SIG'],
|
transmission_sig: headerData['paypal-transmission-sig'],
|
||||||
transmission_time: headerData['PAYPAL-TRANSMISSION-TIME'],
|
transmission_time: headerData['paypal-transmission-time'],
|
||||||
webhook_id: webhookData.webhookId,
|
webhook_id: webhookData.webhookId,
|
||||||
webhook_event: bodyData,
|
webhook_event: bodyData,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue