From b0ad7b0161bb08472b93ce1053f39b10f8a92a62 Mon Sep 17 00:00:00 2001 From: Diego Barrera Date: Thu, 10 May 2018 14:01:16 -0500 Subject: [PATCH] validate birthdate --- gateway/payu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/payu.js b/gateway/payu.js index debad86..691e0bd 100644 --- a/gateway/payu.js +++ b/gateway/payu.js @@ -263,7 +263,7 @@ module.exports.sale = function(payload, credentials, type, cb) { }, }; if (country === 'MX') { - body.payer.birthdate = payload.metadata.birthdate || '1990-05-25'; + body.payer.birthdate = (payload.metadata && payload.metadata.birthdate) ? payload.metadata.birthdate : '1990-05-25'; } if (payload.payment.cvc) { body.transaction.creditCard = {