Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle elements script request block (#209)
- Loading branch information
1 parent
9a72b33
commit 0ced94b
Showing
6 changed files
with
54 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Elements example</title> | ||
<script src="../../dist/basis-theory-js.bundle.js"></script> | ||
<script src="./event-informer.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
window.addEventListener('load', async () => { | ||
try { | ||
await BasisTheory.init('04ab9d12-4959-4c48-ba03-9ef722efcc5a', { | ||
elements: true, | ||
}); | ||
} catch (error) { | ||
informEventCypress(error?.message || error, 'initError'); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
window.informEventCypress = (event, type = event.type) => { | ||
if (window.Cypress) { | ||
return fetch(`http://cypress.test/events/${type}`, { | ||
body: JSON.stringify(event), | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
} | ||
|
||
return Promise.resolve(); | ||
}; |
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
This file was deleted.
Oops, something went wrong.
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
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