Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let wv = new WebView( )
- let html = `
- <!DOCTYPE HTML>
- <HTML>
- <body>
- <button id="link-button">Link Account</button>
- <script src="https://cdn.plaid.com/link/v2/stable/
- link-initialize.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
- <Script type="text/javascript">
- </script>
- </body>
- </html>
- `;
- let js = `
- (function ($) {
- var handler = Plaid.create({
- clientName: '<APP NAME>',
- env: 'sandbox',
- key: '<PLAID PUBLIC KEY>',
- webhook: 'https://[sandbox][api].hydrogenplatform.com/callback/aggregation/plaid',
- product: ['auth', 'transactions'],
- onLoad: function() {
- // Optional, called when Link loads
- },
- onSuccess: function (public_token, metadata) {
- // call integration/v1/token_exchange with client data, see example below
- }
- });
- $('#link-button').on('click', function (e) {
- handler. open();
- });
- })(jQuery);
- `;
- await wv.loadHTML (html);
- await wv.present()
- let result = await wv.evaluateJavaScript(js, true)
- return completion(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement