#composer require stripe/stripe-php
<?php
require_once('vendor/autoload.php');
Stripe\Stripe::setApiKey('sk_test_51zX1hSDCA8Q8MfjPdZLR7oFRlQeJQ1z1W1SoguoffuZbu2WfHyliWa3BAXie3ma45UAgIkQ369cR4bnRNSCh2e6200nbfrbxQb');
$source = Stripe\Source::create(["type" => "wechat", "amount" => 20000,'currency' => 'usd', "metadata" => ["invoice_id" => 'test'], 'redirect'=> [ 'return_url'=>'https://www.xxx.host/callback.php?id=260040&amount=8120¤cy=cny' ] ]);
?>
返回二维码连接
[status] => pending
[type] => wechat
[usage] => single_use
[wechat] => Stripe\StripeObject Object
(
[qr_code_url] => https://stripe.com/sources/test_source?client_secret=src_client_secret_B6l7vfg6XqH7nXPRlFsAEj6r&source=src_1MKdUyDCAxQ8MBjPec73jd1Z
)