Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
};
fakeTokenizationPayload = {
payment_source: {
card: {
last_digits: '1111',
card_type: 'VISA'
}
},
links: []
};
btClientCreate = td.replace(btClient, 'create');
contingencyFlowStart = td.replace(contingencyFlow, 'start');
fakeHostedFieldsInstance = td.object([ 'tokenize' ]);
td.when(fakeHostedFieldsInstance.tokenize(td.matchers.isA(Object))).thenResolve(fakeTokenizationPayload);
hostedFieldsCreate = td.replace(hostedFields, 'create');
fakeBtClient = {
getConfiguration: (conf) => conf
};
td.when(hostedFieldsCreate(td.matchers.isA(Object))).thenResolve(fakeHostedFieldsInstance);
td.when(btClientCreate(td.matchers.isA(Object))).thenResolve(fakeBtClient);
const button = document.createElement('button');
button.id = 'button';
// $FlowFixMe
document.body.appendChild(button);
});
beforeEach(() => {
client = window.paypal.client({
env: 'production',
auth: {
production: 'PROD'
}
});
btClientCreate = td.replace(btClient, 'create');
fakeHostedFieldsInstance = td.object([ 'tokenize' ]);
hostedFieldsCreate = td.replace(hostedFields, 'create');
fakeBtClient = {
getConfiguration: (conf) => conf
};
td.when(hostedFieldsCreate(td.matchers.isA(Object))).thenResolve(fakeHostedFieldsInstance);
td.when(btClientCreate(td.matchers.isA(Object))).thenResolve(fakeBtClient);
});