From 85a5d7851d9bbda9da8b84fb1872f952e637de23 Mon Sep 17 00:00:00 2001 From: Mateja Date: Tue, 20 Jul 2021 19:36:39 +0200 Subject: Added application_context(brand_name) and capture logging. --- server/controllers/transaction.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server') diff --git a/server/controllers/transaction.js b/server/controllers/transaction.js index ee98523..57a0ec3 100644 --- a/server/controllers/transaction.js +++ b/server/controllers/transaction.js @@ -8,6 +8,9 @@ module.exports = { async setup(req, res) { let transactionSetupData = { intent: 'CAPTURE', + application_context: { + brand_name: "MEVN Store" + }, purchase_units: [{ amount: { currency_code: 'USD', @@ -79,8 +82,13 @@ module.exports = { try { const capture = await paypalClient.execute(request); + console.log("CAPTURE======================================================"); console.log(capture); + console.log("CAPTURE.RESULT==============================================="); console.log(capture.result); + console.log("CAPTURE.RESULT.PURCHASE_UNITS[0].SHIPPING===================="); + console.log(capture.result.purchase_units[0].shipping); + console.log("============================================================="); } catch (err) { console.error(err); return res.sendStatus(500); -- cgit v1.2.3