Created
January 5, 2022 20:50
-
-
Save akatakritos/ea9579091751076b51223778e8ea1494 to your computer and use it in GitHub Desktop.
Accept.js webview code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="https://jstest.authorize.net/v1/Accept.js"></script> | |
<script type="text/javascript"> | |
(function () { | |
/** | |
* @param {SecureData} data | |
*/ | |
function send(data) { | |
console.log('send', data); | |
Accept.dispatchData(data, function handleResponse(response) { | |
console.log('handleResponse', response); | |
window.ReactNativeWebView.postMessage(JSON.stringify({ opaqueData: response.opaqueData, messages: response.messages })); | |
}); | |
} | |
function onMessage(message) { | |
console.log(message); | |
} | |
window.API = { | |
send: send, | |
}; | |
})(); | |
</script> | |
</head> | |
<body></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment