orderAck.response no longer a JSON

This commit is contained in:
Daniel Lugo 2021-06-24 11:55:16 -04:00
parent 6841ec64cb
commit ed5a47b1b9

View file

@ -1213,9 +1213,17 @@ const sendSpontaneousPayment = async (
throw e throw e
} }
const decryptedResponse = await SEA.decrypt(
encryptedOrderAckRes.response,
ourSecret
)
logger.info(`decryptedResponse: `, decryptedResponse)
const parsedResponse = JSON.parse(decryptedResponse)
logger.info(`parsedResponse: `, parsedResponse)
/** @type {import('shock-common').Schema.OrderResponse} */ /** @type {import('shock-common').Schema.OrderResponse} */
const orderAck = { const orderAck = {
response: await SEA.decrypt(encryptedOrderAckRes.response, ourSecret), response: parsedResponse,
type: encryptedOrderAckRes.type type: encryptedOrderAckRes.type
} }