on 01-27-2016 12:35 PM
Please reply me experts.
Thanks in advance.
There is no exposed api for that. Read them from csv.
When the codes for a serial voucher are generated internally only a counter is incremented by one by calling Voucher#generateVoucherCode
which calls the SerialVocher#getNextVoucherNumber
(this call adds one to lastVoucherNumber
). Hence, you can caculate the available voucher codes by reverse engeneering the hybris algorithm which does the following.
String code = Vocher#getCode() + Voucher#threeByteHex(voucherNumber);
String sig = Voucher#threeByteSig(clearText);
String realCode = insertDividers(code + sig);
because some of the needed methods are private it is easier to read the voucher codes from the csv file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christopher,
We want to upload a bunch of serial codes via HMC and we found we are able to do it via OOB serial voucher. Issue is that though the uploaded excel sheet gets uploaded into media object succefully. We are not able to apply them. Any pointers or examples around this?
Looks like the values of the serial vouchers would be stored in props table and we need to run some sql like the one below
update props set valuestring1='CVEDzw2HfwFYU0vud1/8Uw==' where ITEMPK=8796093055024 and name='key' update props set valuestring1='8F9ASLDCPM3B5GRK' where ITEMPK=8796093055024 and name='alphabet'
I tried to do insert SQL statements via HAC but I could not commit them. Are you aware of the above SQL statements? If yes, do I have to run the above SQL statements upon changing of the new voucher codes each time? Any example to solve this issue is really appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not 100% sure I understand the question. Are you trying to upload self-generated voucher codes and want them to be "redeemable"? That won't work. The way the algorithm works is different. the Voucher::checkVoucherCode() method checks if the given code is "generally valid" and whether it hasn't been used yet (VoucherInvalidation). But it won't go through any of the generated lists of voucher codes. The values you mention "key" is the AES key used to encrypt "a part" of the voucher code, the "alphabet" defines which characters can appear in the voucher codes.
Please explain a bit more what you are trying to do. I can explain the behavior of the voucher code generation and how it is used during the Voucher::checkVoucherCode() as well, but essentially generating voucher codes is just a helper tool to allow to retrieve voucher codes and e.g. send them to customers etc. You cannot upload your own codes and have them be "valid"/accepted when redeeming vouchers.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.