How to apply for Alipay payment and interface docking processing on the website
1.Register and log in to Alipay official website
2.Create in console - web page /Mobile apps
And fill in the application introduction
Click to generate the application
3.Generate application private key and Alipay public key
In development settings-interface sign-up method (key /Certificate ):- Setting up and viewing
Choose according to your business needs ldquo; Key & rdquo;“ Certificate& rdquo; Form sign-up method
Click Next
Next step: perform security verification
Upload the application public key
Alipay development platform key tool is required
Click Generate the key to copy the generated application public key (Note: you need to record the application private key here, which will be required for payment connection later)
Copy the application public key and generate the Alipay public key (this parameter is required to be passed after payment docking of Alipay public key)
4.Open payment: in product binding - open (computer website payment, mobile website payment)
Business license required for application for opening, enterprise or individual merchant
If it is successfully activated, it can be used to connect to Alipay payment.
5.Payment docking
Here is a payment plugin yansongda
Installation method
composer require yansongda/pay:^2.10 –vvv
use Yansongda\Pay\Pay;
$config = [
'app_id' => '2016082000295641',
'notify_url' => 'http://yansongda.cn/notify.php',
'return_url' => 'http://yansongda.cn/return.php',
'ali_public_key' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuWJKrQ6SWvS6niI+4vEVZiYfjkCfLQfoFI2nCp9ZLDS42QtiL4Ccyx8scgc3nhVwmVRte8f57TFvGhvJD0upT4O5O/lRxmTjechXAorirVdAODpOu0mFfQV9y/T9o9hHnU+VmO5spoVb3umqpq6D/Pt8p25Yk852/w01VTIczrXC4QlrbOEe3sr1E9auoC7rgYjjCO6lZUIDjX/oBmNXZxhRDrYx4Yf5X7y8FRBFvygIE2FgxV4Yw+SL3QAa2m5MLcbusJpxOml9YVQfP8iSurx41PvvXUMo49JG3BDVernaCYXQCoUJv9fJwbnfZd7J5YByC+5KM4sblJTq7bXZWQIDAQAB',
'private_key' => 'MIIEpAIBAAKCAQEAs6+F2leOgOrvj9jTeDhb5q46GewOjqLBlGSs/bVL4Z3fMr3p+Q1Tux/6uogeVi/eHd84xvQdfpZ87A1SfoWnEGH5z15yorccxSOwWUI+q8gz51IWqjgZxhWKe31BxNZ+prnQpyeMBt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ECgYAGIZ0HIiE0Y+g9eJnpUFelXvsCEUW9YNK4065SD/BBGedmPHRC3OLgbo8X5A9BNEf6vP7fwpIiRfKhcjqqzOuk6fueA/yvYD04v+Da2MzzoS8+hkcqF3T3pta4I4tORRdRfCUzD80zTSZlRc/h286Y2eTETd+By1onnFFe2X01mwKBgQDaxo4PBcLL2OyVT5DoXiIdTCJ8KNZL9+kV1aiBuOWxnRgkDjPngslzNa1bK+klGgJNYDbQqohKNn1HeFX3mYNfCUpuSnD2Yag53Dd/1DLO+NxzwvTu4D6DCUnMMMBVaF42ig31Bs0jI3JQZVqeeFzSET8fkoFopJf3G6UXlrIEAQ==',
'log' => [ // optional
'file' => './logs/alipay.log',
'level' => 'info', // It is recommended to adjust the production environment level to info, The development environment is debug
'type' => 'single', // optional, Optional daily.
'max_file' => 30, // optional, when type for daily Valid when it is, default is 30 days
],
'http' => [ // optional
'timeout' => 5.0,
'connect_timeout' => 5.0,
// For more configuration items, please refer to [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html)
],
// 'mode' => 'dev', // optional, Set this parameter to enter sandbox mode
];
// Pay
$order = [
'out_trade_no' => time(),
'total_amount' => '1',
'subject' => 'test subject - test',
];
$alipay = Pay::alipay($config)->web($order);
return $alipay->send();// laravel Please directly in the framework `return $alipay`
// Refund
$order = [
'out_trade_no' => '1514027114',
'refund_amount' => '0.01',
];
$result = Pay::alipay($config)->refund($order); // return `Yansongda\Supports\Collection` Examples can be passed `$result->xxx` Access the data returned by the server.
// Query
$result = Pay::alipay($config)->find('out_trade_no_123456'); // return `Yansongda\Supports\Collection` Examples can be passed `$result->xxx` Access the data returned by the server.
// Cancel
$result = Pay::alipay($config)->cancel('out_trade_no_123456'); // return `Yansongda\Supports\Collection` Examples can be passed `$result->xxx` Access the data returned by the server.
// closure
$result = Pay::alipay($config)->close('out_trade_no_123456'); // return `Yansongda\Supports\Collection` Examples can be passed `$result->xxx` Access the data returned by the server.
// Verify server data
$alipay = Pay::alipay($config)
// Yes, it’s that simple to verify your visa!
$data = $alipay->verify(); // return `Yansongda\Supports\Collection` Examples can be passed `$data->xxx` Access the data returned by the server.
$alipay->success()->send(); // Confirm the received data to the Alipay server. laravel Please directly in the framework `return $alipay->success()`
$alipay = Pay::alipay($config)
Computer payment
return $alipay->web($order)->send();
Mobile payment
return $alipay->wap($order)->send();
appPay
return $alipay->app($order)->send();
Pay by swiping card
return $alipay->pos ($order)->send();
Scan the QR code to pay
$result = $alipay->scan($order)->send();
return $qr = $result->qr_code;
Account transfer
$result = $alipay->transfer($order);
Mini Program Payment
$result = $alipay->mini($order);

The above is the "How to apply for Alipay payment and interface docking processing on the website" shared by Suyou Network with everyone. Thank you very much for reading this article patiently. We will provide you with more information on reference, use or learning and communication.We can also provide you with:Enterprise website construction, website imitation, website copying, imitation site, foreign trade website construction, foreign trade website construction, company official website productionFor services, our company serves customers with the service concept of "integrity, professionalism, pragmatism and innovation".If you need cooperation, please scan the code to consult, and we will serve you sincerely.
TAG Label: