From 7ce68a4dfc04dc8fb08462bfcc5c675c272c026e Mon Sep 17 00:00:00 2001 From: Cristian Vladescu Date: Sat, 18 Feb 2023 22:00:40 +0200 Subject: [PATCH] Fixed paypal button callback function `createOrder` is expects to return an order ID, not the whole json --- hosted-fields/public/buttons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosted-fields/public/buttons.js b/hosted-fields/public/buttons.js index 64fae6c..0056d3d 100644 --- a/hosted-fields/public/buttons.js +++ b/hosted-fields/public/buttons.js @@ -12,7 +12,7 @@ paypal }, // Sets up the transaction when a payment button is clicked createOrder(data, actions) { - return api.createOrder(); + return api.createOrder().id; }, // Finalize the transaction after payer approval async onApprove(data, actions) {