HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/ssss.umchkw.com/2/client/index.html
<!-- Load Stripe.js on your website. -->
<script src="https://js.stripe.com/v3"></script>

<!-- Create a button that your customers click to complete their purchase. Customize the styling to suit your branding. -->
<button
  style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em"
  id="checkout-button-sku_xxxxxxxxxxx"
  role="link"
>
  Checkout
</button>

<div id="error-message"></div>

<script>
(function() {
  var stripe = Stripe('pk_test_51Lmp8ZLOGF67C0rHewCkrJOMQkQrV1l6pI222IQ4QJ305cNcgwsKOsi03FeLHmMuat1jbj0PKwntp0fxswTb3BPN00g20hrgcW');

  var checkoutButton = document.getElementById('checkout-button-sku_G40GQYkIX4a8c4');
  checkoutButton.addEventListener('click', function () {
    // When the customer clicks on the button, redirect
    // them to Checkout.
    stripe.redirectToCheckout({
      items: [{sku: 'sku_xxxxxxxxxxx', quantity: 1}],

      // Do not rely on the redirect to the successUrl for fulfilling
      // purchases, customers may not always reach the success_url after
      // a successful payment.
      // Instead use one of the strategies described in
      // https://stripe.com/docs/payments/checkout/fulfillment
      successUrl: 'https://xxx.xxx.xx/success',
      cancelUrl: 'https://xxx.xxx.xx/canceled',
    })
    .then(function (result) {
      if (result.error) {
        // If `redirectToCheckout` fails due to a browser or network
        // error, display the localized error message to your customer.
        var displayError = document.getElementById('error-message');
        displayError.textContent = result.error.message;
      }
    });
  });
})();
</script>


<button id="checkout-button">
    立即购买
</button>
<script src="https://js.stripe.com/v3/"></script>
<script type="text/javascript">
    (function() {
      var stripe = Stripe('pk_xxxxxxxxxxxxxx');

      var checkout-button = document.getElementById('checkout-button');

      checkout-button.addEventListener('click', function () {
        stripe.createSource({
          type: 'alipay',
          amount: 1988,
          currency: 'hkd',
          // 这里你需要渲染出一些用户的信息,不然后期没法知道是谁在付钱
          owner: {
            email: '{$user_email}',
          },
          redirect: {
            return_url: 'https://xxx.xxx.xx/buy',
          },
        }).then(function(result) {
          window.location.replace(result.source.redirect.url);
        });
      });

    })();
</script>