From abc1e25902e9ffd94a31e0d927bc721fe429d014 Mon Sep 17 00:00:00 2001 From: "J. Bishop" Date: Wed, 31 Jul 2019 13:55:12 -0600 Subject: [PATCH] payload state inside authorizationDetails --- lambda/custom/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lambda/custom/index.js b/lambda/custom/index.js index 71c008e..2c8ee47 100644 --- a/lambda/custom/index.js +++ b/lambda/custom/index.js @@ -264,11 +264,11 @@ const ChargeConnectionsResponseHandler = { return error.handleErrors( handlerInput ); } - const authorizationStatusState = connectionResponsePayload.authorizationDetails.state; - + const authorizationStatusState = connectionResponsePayload.authorizationDetails.authorizationStatus.state; + // Authorization is declined, tell the customer their order was not placed if( authorizationStatusState === 'Declined' ) { - const authorizationStatusReasonCode = connectionResponsePayload.authorizationDetails.reasonCode; + const authorizationStatusReasonCode = connectionResponsePayload.authorizationDetails.authorizationStatus.reasonCode; return error.handleAuthorizationDeclines( authorizationStatusReasonCode, handlerInput );