File tree Expand file tree Collapse file tree
src/server/plugins/payment Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function getPaymentApiKey(isLivePayment, formId) {
2020
2121 if ( ! apiKeyValue ) {
2222 throw new Error (
23- `Missing payment api key for ${ isLivePayment ? 'live' : 'test' } form id ${ formId } `
23+ `[payment] Missing payment api key for ${ isLivePayment ? 'live' : 'test' } form id ${ formId } `
2424 )
2525 }
2626 return apiKeyValue
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ export class PaymentService {
4747 delayed_capture : true
4848 } )
4949
50+ logger . info (
51+ `[payment] Created payment and user taken to enter pre-auth details for paymentId=${ response . payment_id } `
52+ )
53+
5054 return {
5155 paymentId : response . payment_id ,
5256 paymentUrl : response . _links . next_url . href
@@ -77,8 +81,13 @@ export class PaymentService {
7781 throw new Error ( `Failed to get payment status: ${ errorMessage } ` )
7882 }
7983
84+ const state = response . payload . state
85+ logger . info (
86+ `[payment] Got payment status for paymentId=${ paymentId } : ${ state . status } message:${ state . message ?? 'N/A' } code:${ state . code ?? 'N/A' } `
87+ )
88+
8089 return {
81- state : response . payload . state ,
90+ state,
8291 _links : response . payload . _links ,
8392 email : response . payload . email ,
8493 paymentId : response . payload . payment_id ,
@@ -114,7 +123,9 @@ export class PaymentService {
114123 statusCode === StatusCodes . OK ||
115124 statusCode === StatusCodes . NO_CONTENT
116125 ) {
117- logger . info ( `[payment] Successfully captured payment ${ paymentId } ` )
126+ logger . info (
127+ `[payment] Successfully captured payment for paymentId=${ paymentId } `
128+ )
118129 return true
119130 }
120131
You can’t perform that action at this time.
0 commit comments