sber-acquiring
v1.3.0
Published
sberbank acquiring
Downloads
9
Readme
sber-acquiring
verify callback
import {SberAcquiring} from "sber-acquiring";
const cert = '-----BEGIN CERTIFICATE-----\n' +
'MIICcTCCAdqgAwIBAgIGAWAnZt3aMA0GCSqGSIb3DQEBCwUAMHwxIDAeBgkqhkiG9w0BCQEWEWt6\n' +
'bnRlc3RAeWFuZGV4LnJ1MQswCQYDVQQGEwJSVTESMBAGA1UECBMJVGF0YXJzdGFuMQ4wDAYDVQQH\n' +
'EwVLYXphbjEMMAoGA1UEChMDUkJTMQswCQYDVQQLEwJRQTEMMAoGA1UEAxMDUkJTMB4XDTE3MTIw\n' +
'NTE2MDEyMFoXDTE4MTIwNTE2MDExOVowfDEgMB4GCSqGSIb3DQEJARYRa3pudGVzdEB5YW5kZXgu\n' +
'cnUxCzAJBgNVBAYTAlJVMRIwEAYDVQQIEwlUYXRhcnN0YW4xDjAMBgNVBAcTBUthemFuMQwwCgYD\n' +
'VQQKEwNSQlMxCzAJBgNVBAsTAlFBMQwwCgYDVQQDEwNSQlMwgZ8wDQYJKoZIhvcNAQEBBQADgY0A\n' +
'MIGJAoGBAJNgxgtWRFe8zhF6FE1C8s1t/dnnC8qzNN+uuUOQ3hBx1CHKQTEtZFTiCbNLMNkgWtJ/\n' +
'CRBBiFXQbyza0/Ks7FRgSD52qFYUV05zRjLLoEyzG6LAfihJwTEPddNxBNvCxqdBeVdDThG81zC0\n' +
'DiAhMeSwvcPCtejaDDSEYcQBLLhDAgMBAAEwDQYJKoZIhvcNAQELBQADgYEAfRP54xwuGLW/Cg08\n' +
'ar6YqhdFNGq5TgXMBvQGQfRvL7W6oH67PcvzgvzN8XCL56dcpB7S8ek6NGYfPQ4K2zhgxhxpFEDH\n' +
'PcgU4vswnhhWbGVMoVgmTA0hEkwq86CA5ZXJkJm6f3E/J6lYoPQaKatKF24706T6iH2htG4Bkjre\n' +
'gUA=\n' +
'-----END CERTIFICATE-----';
const qs = 'amount=35000099&sign_alias=&checksum=163BD9FAE437B5DCDAAC4EB5ECEE5E5' +
'33DAC7BD2C8947B0719F7A8BD17C101EBDBEACDB295C10BF041E903AF3FF1E6101FF7DB9BD024C' +
'6272912D86382090D5A7614E174DC034EBBB541435C80869CEED1F1E1710B71D6EE7F52AE35450' +
'5A83A1E279FBA02572DC4661C1D75ABF5A7130B70306CAFA69DABC2F6200A698198F8&mdOrder=' +
'12b59da8-f68f-7c8d-12b5-9da8000826ea&operation=deposited&status=1';
if (SberAcquiring.verifyCallback(qs, cert).unwrap()) {
console.log('[OK] qs:', qs);
} else {
console.log('[FAIL] qs:', qs);
}
const qs2 = 'amount=100&sign_alias=&checksum=163BD9FAE437B5DCDAAC4EB5ECEE5E5' +
'33DAC7BD2C8947B0719F7A8BD17C101EBDBEACDB295C10BF041E903AF3FF1E6101FF7DB9BD024C' +
'6272912D86382090D5A7614E174DC034EBBB541435C80869CEED1F1E1710B71D6EE7F52AE35450' +
'5A83A1E279FBA02572DC4661C1D75ABF5A7130B70306CAFA69DABC2F6200A698198F8&mdOrder=' +
'12b59da8-f68f-7c8d-12b5-9da8000826ea&operation=deposited&status=1';
if (SberAcquiring.verifyCallback(qs2, cert).unwrap()) {
console.log('[OK] qs:', qs2);
} else {
console.log('[FAIL] qs:', qs2);
}