This repository was archived by the owner on Jan 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 22 * Payment Service
33 * Interacts with InformixDB
44 */
5+ const util = require ( 'util' )
56const logger = require ( '../common/logger' )
67const helper = require ( '../common/helper' )
78const config = require ( 'config' ) ;
@@ -58,7 +59,7 @@ async function paymentExists(payment) {
5859 logger . debug ( `Checking if paymentExists - ${ query } ` )
5960 return connection . queryAsync ( query )
6061 } catch ( e ) {
61- logger . error ( `Error in 'getGroupsForChallenge ' ${ e } ` )
62+ logger . error ( `Error in 'paymentExists ' ${ e } ` )
6263 throw e
6364 } finally {
6465 await connection . closeAsync ( )
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ async function processUpdate(message) {
5757 } , basePayment )
5858
5959 const paymentExists = await paymentService . paymentExists ( payment )
60- if ( ! paymentExists ) {
60+ logger . debug ( `Payment Exists Response: ${ JSON . stringify ( paymentExists ) } ` )
61+ if ( ! paymentExists || paymentExists . length === 0 ) {
6162 await paymentService . createPayment ( payment )
6263 } else {
6364 logger . error ( `Payment Exists for ${ v5ChallengeId } , skipping - ${ JSON . stringify ( paymentExists ) } ` )
@@ -86,7 +87,8 @@ async function processUpdate(message) {
8687 typeId : config . COPILOT_PAYMENT_TYPE_ID
8788 } , basePayment )
8889 const paymentExists = await paymentService . paymentExists ( copilotPayment )
89- if ( ! paymentExists ) {
90+ logger . debug ( `Copilot Payment Exists Response: ${ JSON . stringify ( paymentExists ) } ` )
91+ if ( ! paymentExists || paymentExists . length === 0 ) {
9092 await paymentService . createPayment ( copilotPayment )
9193 } else {
9294 logger . error ( `Copilot Payment Exists for ${ v5ChallengeId } , skipping - ${ JSON . stringify ( paymentExists ) } ` )
You can’t perform that action at this time.
0 commit comments