Rappi signature

node v15.12.0
version: 1.0.0
endpointsharetweet
This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out:
const crypto = require('crypto') /*****RAPPI SIGNATURE******/ //t=1617207395878,sign=cebadadf8a3738e8fa1dac85f4083fcdab284d7af1426fe8c783d0ba0d189ee7 /**************************/ var hmac = crypto.createHmac('sha256', 'C928197B72C1400DE151768ED61137A66A1825350E0A4836E790299CC6ED7431') const data = hmac.update('1617207395878.{"order_detail":{"order_id":"132002","cooking_time":15,"min_cooking_time":10,"max_cooking_time":20,"created_at":"2021-03-31 18:16:34","delivery_method":"delivery","payment_method":"cc","billing_information":{"billing_type":"Factura","name":"client","address":"Some street 12345","phone":"43333222","email":"[email protected]","document_type":"DNI","document_number":"32432342"},"delivery_information":null,"totals":{"total_products_with_discount":3000,"total_products_without_discount":3000,"total_other_discounts":0,"total_order":3000,"total_to_pay":0,"charges":{"shipping":0,"service_fee":0},"other_totals":{"total_rappi_credits":0,"total_rappi_pay":0,"tip":0}},"items":[{"sku":null,"id":"2135528720","name":"Agua","type":"product","comments":null,"unit_price_with_discount":1500,"unit_price_without_discount":1500,"percentage_discount":0,"quantity":2,"subitems":[]}],"delivery_discount":null},"customer":null,"store":{"internal_id":"900103690","external_id":"900103690","name":"Ordatic Test PAV2"}}') const result = data.digest('hex') console.log('rappiS....', 'cebadadf8a3738e8fa1dac85f4083fcdab284d7af1426fe8c783d0ba0d189ee7') console.log('ordatS....', result) console.log('result....', result === 'cebadadf8a3738e8fa1dac85f4083fcdab284d7af1426fe8c783d0ba0d189ee7')
Loading…

no comments

    sign in to comment