mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
:tap: Fix environment typo in PayPal node (#1310)
This commit is contained in:
parent
2fed026523
commit
a13a7487cf
|
@ -22,7 +22,7 @@ export class PayPalApi implements ICredentialType {
|
|||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Enviroment',
|
||||
displayName: 'Environment',
|
||||
name: 'env',
|
||||
type: 'options' as NodePropertyTypes,
|
||||
default: 'live',
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
|
||||
export async function payPalApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, endpoint: string, method: string, body: any = {}, query?: IDataObject, uri?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
const credentials = this.getCredentials('payPalApi');
|
||||
const env = getEnviroment(credentials!.env as string);
|
||||
const env = getEnvironment(credentials!.env as string);
|
||||
const tokenInfo = await getAccessToken.call(this);
|
||||
const headerWithAuthentication = Object.assign({ },
|
||||
{ Authorization: `Bearer ${tokenInfo.access_token}`, 'Content-Type': 'application/json' });
|
||||
|
@ -43,7 +43,7 @@ export async function payPalApiRequest(this: IHookFunctions | IExecuteFunctions
|
|||
}
|
||||
}
|
||||
|
||||
function getEnviroment(env: string): string {
|
||||
function getEnvironment(env: string): string {
|
||||
// @ts-ignore
|
||||
return {
|
||||
'sanbox': 'https://api.sandbox.paypal.com',
|
||||
|
@ -56,7 +56,7 @@ async function getAccessToken(this: IHookFunctions | IExecuteFunctions | IExecut
|
|||
if (credentials === undefined) {
|
||||
throw new Error('No credentials got returned!');
|
||||
}
|
||||
const env = getEnviroment(credentials!.env as string);
|
||||
const env = getEnvironment(credentials!.env as string);
|
||||
const data = Buffer.from(`${credentials!.clientId}:${credentials!.secret}`).toString(BINARY_ENCODING);
|
||||
const headerWithAuthentication = Object.assign({},
|
||||
{ Authorization: `Basic ${data}`, 'Content-Type': 'application/x-www-form-urlencoded' });
|
||||
|
|
Loading…
Reference in a new issue