diff --git a/public/examples/ach.html b/public/examples/ach.html index ca54f0a..c2b6e7c 100644 --- a/public/examples/ach.html +++ b/public/examples/ach.html @@ -40,7 +40,7 @@ throw new Error(errorBody); } - function tokenize(paymentMethod, options = {}) { + async function tokenize(paymentMethod, options = {}) { paymentMethod.addEventListener( 'ontokenization', async function (event) { @@ -65,7 +65,7 @@ } } ); - paymentMethod.tokenize(options); + await paymentMethod.tokenize(options); } // status is either SUCCESS or FAILURE; @@ -139,7 +139,7 @@ try { achButton.disabled = true; - tokenize(paymentMethod, options); + await tokenize(paymentMethod, options); } catch (e) { achButton.disabled = false; displayPaymentResults('FAILURE');