mirror of
https://github.com/valitydev/checkout.git
synced 2024-11-06 10:35:20 +00:00
Fix fingerptint (#319)
This commit is contained in:
parent
216d4949f5
commit
577321f49c
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user