PHP code example of fishlab / alipay-sdk-php

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

    

fishlab / alipay-sdk-php example snippets




$alipay_config =[];
/// --- xx';

// api_rsa_private_key.pem';

// lly,seller_id equals partner
// $alipay_config['seller_id'] = $alipay_config['partner'];
// $alipay_config['ali_public_key_path']= 'key/alipay_public_key.pem';

// sign type,defualt is RSA
// $alipay_config['sign_type'] = 'RSA';

// support gbk or utf-8,default 'utf-8'
// $alipay_config['input_charset'] = 'utf-8';

// transfer protocol
// $alipay_config['transport'] = 'https';




$config = [
		'alipay_public_key_file' => __DIR__. "/key/alipay_openapi_rsa_public_key.pem",
		'merchant_private_key_file' => "you/openapi_rsa_private_key.pem",
		'charset' => "UTF-8",
		'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
		'app_id' => "2015123456000000"
];
shell
composer