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//zhifu.ws.umchkw.com/3.php
<?php
require_once('vendor/autoload.php'); // 引入 Stripe PHP SDK

 
$stripe = new \Stripe\StripeClient('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');

// 创建 Stripe Checkout 会话
$checkout_session =$stripe->checkout->sessions->create(
[
    
    'line_items' => [[
        'price_data' => [
            'currency' => 'GBP',
            'unit_amount' => 2000,
            'product_data' => [
                'name' => 'Awesome T-shirt'
            ],
        ],
        'quantity' => 1,
    ]],
    'mode' => 'payment',
     'allow_promotion_codes' => true,
    'success_url' => 'https://example.com/success',
    'cancel_url' => 'https://example.com/cancel',
]

 



);

// 处理支付结果
if ($checkout_session->payment_status == 'paid') {
    // 支付成功
    $transaction_id = $checkout_session->id; // 获取交易标识符
    // 在这里完成其他的业务逻辑,例如保存订单信息到数据库中等等
} else {
    // 支付失败
    // 在这里完成失败后的逻辑处理,例如提示用户支付失败等等
}

// 输出交易标识符
echo $transaction_id;
?>