Skip to content

Instantly share code, notes, and snippets.

@praxxis
Last active February 3, 2025 20:20
Show Gist options
  • Save praxxis/41f1029141802f3cb15a5c7d54a7aa1c to your computer and use it in GitHub Desktop.
Save praxxis/41f1029141802f3cb15a5c7d54a7aa1c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<script src="https://portal.qa.afterpay-beta.com/afterpay.js"></script>
</head>
<body>
<main>
<h1>Home page</h1>
<button type="button" id="button">AP</button>
</main>
</body>
<script>
document.getElementById('button').onclick = function () {
AfterPay.initialize({ countryCode: 'US' });
AfterPay.open();
AfterPay.onComplete = function (event) {
console.log(event.data);
};
AfterPay.transfer({
token: '002.srpannc1ednh24fumfv98l7n4qjmb8oq30p6iaej1hum1p04',
});
};
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment