Fix fingerptint (#319)

This commit is contained in:
Rinat Arsaev 2020-02-20 14:40:41 +03:00 committed by GitHub
parent 216d4949f5
commit 577321f49c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,11 @@ import { PaymentResource, PaymentTool } from 'checkout/backend/model';
import v from './capi-version';
import { fetchCapi } from './fetch-capi';
function getFingerprintFromComponents(components: Fingerprint2.Component[]) {
const values = components.map(({ value }) => value);
return Fingerprint2.x64hash128(values.join(''), 31);
}
export const createPaymentResource = (
capiEndpoint: string,
accessToken: string,
@ -16,7 +21,7 @@ export const createPaymentResource = (
body: {
paymentTool,
clientInfo: {
fingerprint: Fingerprint2.x64hash128(fingerprintComponents.join(''), 31)
fingerprint: getFingerprintFromComponents(fingerprintComponents)
}
}
})