From c0a437c4b1c4ce39b44f92b5c4a21d94c85b72b4 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:39:23 -0500 Subject: [PATCH] chore: use es6 syntax to match public docs --- standard-integration/public/index.html | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/standard-integration/public/index.html b/standard-integration/public/index.html index 7abaf8cc..7ba43047 100644 --- a/standard-integration/public/index.html +++ b/standard-integration/public/index.html @@ -12,9 +12,9 @@ paypal .Buttons({ // Sets up the transaction when a payment button is clicked - createOrder: function () { + createOrder() { return fetch("/my-server/create-paypal-order", { - method: "post", + method: "POST", headers: { "Content-Type": "application/json", }, @@ -33,9 +33,9 @@ .then((order) => order.id); }, // Finalize the transaction after payer approval - onApprove: function (data) { + onApprove(data) { return fetch("/my-server/capture-paypal-order", { - method: "post", + method: "POST", headers: { "Content-Type": "application/json", }, @@ -52,13 +52,7 @@ JSON.stringify(orderData, null, 2) ); const transaction = orderData.purchase_units[0].payments.captures[0]; - alert( - "Transaction " + - transaction.status + - ": " + - transaction.id + - "\n\nSee console for all available details" - ); + alert(`Transaction ${transaction.status}: ${transaction.id}\n\nSee console for all available details`); // When ready to go live, remove the alert and show a success message within this page. For example: // var element = document.getElementById('paypal-button-container'); // element.innerHTML = '