From f7bf38a0457b1b00c777eb7af6ffcd2c5ebe384a Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <gua@adhisimon.org>
Date: Thu, 12 Apr 2018 15:26:16 +0700
Subject: [PATCH] auto resend dari config

---
 partner-simplepay.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/partner-simplepay.js b/partner-simplepay.js
index b10b5be..7d226f2 100644
--- a/partner-simplepay.js
+++ b/partner-simplepay.js
@@ -52,7 +52,7 @@ function callbackReport(requestId, rc, message, options) {
 
     //return;
     // resend trx as status check if rc 68 and task is defined
-    if (options && options.task && (rc == '68')) {
+    if (config && config.partner.auto_resend && Number(config.partner.auto_resend) && options && options.task && (rc == '68')) {
         logger.verbose('Got pending trx, requesting in ' + seconds_to_wait_before_resend_on_pending + ' secs');
         setTimeout(function() {
             checkStatus(options.task);
-- 
1.9.0