| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <!-- s-->
- <title></title>
- <style type="text/css">
- body{
- width: 50%;
- margin: auto;
- }
- .pay_b {
- font-size: 12px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- line-height: 28px;
- color: #000000;
- margin-right: 10px;
- }
- </style>
- </head>
- <body>
- <div class="pay">
- <div class="paytwo">
- <div class="pay_b">
- <span>商品:</span>
- <span style="color:#FB5E5E ;">{$result['goods']}</span>
- </div>
- </div>
- <div id="dropIn"></div>
- </div>
- </body>
- <script src="https://checkout.airwallex.com/assets/elements.bundle.min.js"></script>
- <script>
- var id = "{$result['id']}"
- var client_secret = "{$result['client_secret']}"
- var currency = "{$result['currency']}"
- Airwallex.init({
- env: 'prod', // Setup which Airwallex env('demo' | 'prod') to integrate with
- origin: window.location.origin, // Set up your event target to receive the browser events message
- });
- const element = Airwallex.createElement('dropIn', {
- intent_id: id,
- client_secret: client_secret,
- currency:currency,
- });
- element.mount('dropIn'); // Injects iframe into the Drop-in Element container
- window.addEventListener('onReady', (event) => {
- /*
- ... Handle event
- */
- // window.alert(event.detail);
- console.log(event)
- });
- window.addEventListener('onSuccess', (event) => {
- // Handle event on success
- console.log(event)
- });
- window.addEventListener('onError', (event) => {
- // Handle event on error
- console.log(event)
- });
- </script>
- </html>
|