PHP code example of imxiangli / yii2-alipay

1. Go to this page and download the library: Download imxiangli/yii2-alipay 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/ */

    

imxiangli / yii2-alipay example snippets


'components' => [
    // ...
    'alipay' => [
        'class' => \imxiangli\alipay\Alipay::className(),
        'partner' => '',
        'seller_id' => '',
        'seller_user_id' => '',
        'private_key' => '',
        'alipay_public_key' => '',
        'notify_url' => '',
        'return_url' => '',
        'refund_notify_url' => '',
        'sign_type' => '',
        'input_charset' => '',
        'cacert' => '',
        'transport' => '',
        'anti_phishing_key' => '',
        'exter_invoke_ip' => '',
    ],
    // ...
],

// pay request
Yii::$app->alipay->buildPayRequestForm($out_trade_no, $subject, $total_fee, $body);

// refund request
Yii::$app->alipay->buildRefundRequestForm($refund_date, $batch_no, $detail_data);

php composer.phar