From 39acc40dd39a938d2a0bc099fa62541b5bf2684b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Pic=C3=B3?= Date: Fri, 24 Dec 2021 14:28:09 +0100 Subject: [PATCH] Set code type on readme.md examples Set the type of code in the examples to Javascript so that readme.md is rendered with fully colored examples. --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 021dceb..b42e637 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,7 @@ Node.js Redsys api implementation with new the key-hashed message authentication ### Obtain signature and merchant parameters -````` +```js const Redsys = require('node-redsys-api').Redsys; function createPayment(description, total, titular, orderId, paymentId) { @@ -29,11 +29,11 @@ function createPayment(description, total, titular, orderId, paymentId) { return { signature: redsys.createMerchantSignature(TPVConfig.secret, mParams), merchantParameters: redsys.createMerchantParameters(mParams), raw: mParams }; } -````` +``` ### Process TPV callback -````` +```js const merchantParams = response.Ds_MerchantParameters || response.DS_MERCHANTPARAMETERS; const signature = response.Ds_Signature || response.DS_SIGNATURE; @@ -48,7 +48,7 @@ if (redsys.merchantSignatureIsValid(signature, merchantSignatureNotif) && dsResp /* 'TPV payment is KO; ... */ } -````` +``` ## Tests