PHP code example of jundayw / laravel-payment

1. Go to this page and download the library: Download jundayw/laravel-payment library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jundayw / laravel-payment example snippets


$message = new PaymentRequest();

$message->setSubject('测试456');
$message->setAmount(0.01);
$message->setOutTradeNo('' . time());
$message->setAttach([
    'id' => 1,
]);

$message->setBuyerId('[email protected]');
$message->setBuyerId('2088722004475227');
$message->setAuthCode('130842561143513043');

return Payment::provider('wechat')->pay('wap', $message);