Skip to content

Commit 0806635

Browse files
authored
chore: use es6 syntax to match public docs (#59)
1 parent 5dd4bce commit 0806635

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

standard-integration/public/index.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
paypal
1313
.Buttons({
1414
// Sets up the transaction when a payment button is clicked
15-
createOrder: function () {
15+
createOrder() {
1616
return fetch("/my-server/create-paypal-order", {
17-
method: "post",
17+
method: "POST",
1818
headers: {
1919
"Content-Type": "application/json",
2020
},
@@ -33,9 +33,9 @@
3333
.then((order) => order.id);
3434
},
3535
// Finalize the transaction after payer approval
36-
onApprove: function (data) {
36+
onApprove(data) {
3737
return fetch("/my-server/capture-paypal-order", {
38-
method: "post",
38+
method: "POST",
3939
headers: {
4040
"Content-Type": "application/json",
4141
},
@@ -52,13 +52,7 @@
5252
JSON.stringify(orderData, null, 2)
5353
);
5454
const transaction = orderData.purchase_units[0].payments.captures[0];
55-
alert(
56-
"Transaction " +
57-
transaction.status +
58-
": " +
59-
transaction.id +
60-
"\n\nSee console for all available details"
61-
);
55+
alert(`Transaction ${transaction.status}: ${transaction.id}\n\nSee console for all available details`);
6256
// When ready to go live, remove the alert and show a success message within this page. For example:
6357
// var element = document.getElementById('paypal-button-container');
6458
// element.innerHTML = '<h3>Thank you for your payment!</h3>';

0 commit comments

Comments
 (0)