Skip to content

Commit

Permalink
Merge pull request #970 from OpenSourceFellows/merge_var_logging
Browse files Browse the repository at this point in the history
Added logging to debug merge_vars
  • Loading branch information
DietBepis1 authored Oct 15, 2024
2 parents 6eb8027 + 0af55e4 commit 0a41148
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions server/routes/api/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,14 @@ router.post('/process-transaction', async (req, res) => {
const transaction = await Transaction.query().findOne({ stripe_transaction_id: paymentIntent })
await transaction.$query().patch({ status: eventOutcome })

console.log(`transaction = ${transaction.id}, ${transaction.status}`)

const letter = await Letter.query().where({ transaction_id: transaction.id }).first()
letter.trackingNumber = uuidv4()
const letterTemplate = JSON.parse(letter.letterTemplate)

console.log(`letter: ${letter.id}, ${letterTemplate}`)

const lobApiKey = process.env.LOB_API_KEY
const lobCredentials = btoa(`${lobApiKey}:`)

console.log(letter.addressee, letter.addressLine1)
console.log(letter.mergeVariables)
const lobResponse = await axios.post(
'https://api.lob.com/v1/letters',
{
Expand Down

0 comments on commit 0a41148

Please sign in to comment.