B站设置

墨逸工作室AB支付 分为3个步骤。

B站要求

  • b站必须使用 PHP 创建(例如 WordPress、OpenCart、ZenCart 等)。
  • b站的服务器必须使用PHP 7.4和MySQL 5.7。
  • b站必须能够自定义伪静态。
  • b站必须提供合法的产品或服务(支付网关可接受的产品或服务)。

B站设置步骤

  1. 将网关文件上传至b站的安装目录。
  2. 修改网关文件里面的MySQL连接信息。
  3. 导入数据库文件。
  4. 为b站网站设置伪静态。

将发送给你的ab文件夹内的B站文件的security_gateway.zip压缩包上传到您网站的源码目录并解压即可。
解压后你将获得一个security_gateway的文件夹。

进入security_gateway文件夹然后找到include文件夹 进入include文件夹内,找到config.php,编辑config.php文件内的:

 define(‘DB_USERNAME_GATEWAY’, ‘您b站的数据库用户名’);
define(‘DB_PASSWORD_GATEWAY’, ‘您b站的数据库密码’);
define(‘DB_NAME_GATEWAY’, ‘您b站的数据库名’);

这三项 把中文字改为你B 站数据库的连接信息。

继续修改database.php 文件
define(‘DB_USERNAME_GATEWAY’, ‘您b站的数据库用户名’);
define(‘DB_PASSWORD_GATEWAY’, ‘您b站的数据库密码’);
define(‘DB_NAME_GATEWAY’, ‘您b站的数据库名’);

将这三项修改为 您B站数据库连接信息

将发送给你的ab文件夹内的B站文件的database.sql文件导入到您B站的数据库内即可

B站为wordpress

如果你的服务器是 Nginx

请设置以下的伪静态。

				
					location / {
    try_files $uri $uri/ /index.php?$args;
}

location ~* ^/create_payment/(.*)$ {
    rewrite ^/create_payment/(.*)$ /security_gateway/gateway.php?action=create_payment last;
}

location ~* ^/search/(.*)$ {
    rewrite ^/search/(.*)$ /security_gateway/gateway.php?action=search last;
}

location ~* ^/comfirm/(.*)$ {
    rewrite ^/comfirm/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 last;
}

location ~* ^/cancel/(.*)$ {
    rewrite ^/cancel/(.*)$ /security_gateway/gateway.php?action=cancel&pay_no=$1 last;
}

location ~* ^/return/(.*)$ {
    rewrite ^/return/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 last;
}

location ~* ^/checkout/(.*)$ {
    rewrite ^/checkout/(.*)$ /security_gateway/gateway.php?action=checkout&pay_no=$1 last;
}

location ~* ^/notify/(.*)$ {
    rewrite ^/notify/(.*)$ /security_gateway/gateway.php?action=notify&pay_no=$1 last;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;
				
			

如果你的服务器是用的Apache

请设置以下的伪静态。

				
					<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # 自定义规则
    RewriteRule ^create_payment/(.*)$ /security_gateway/gateway.php?action=create_payment [L,QSA]
    RewriteRule ^search/(.*)$ /security_gateway/gateway.php?action=search [L,QSA]
    RewriteRule ^comfirm/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 [L,QSA]
    RewriteRule ^cancel/(.*)$ /security_gateway/gateway.php?action=cancel&pay_no=$1 [L,QSA]
    RewriteRule ^return/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 [L,QSA]
    RewriteRule ^checkout/(.*)$ /security_gateway/gateway.php?action=checkout&pay_no=$1 [L,QSA]
    RewriteRule ^notify/(.*)$ /security_gateway/gateway.php?action=notify&pay_no=$1 [L,QSA]

    # WordPress 规则
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
				
			

关于伪静态设置,我们提供的伪静态是已经包含了WP网站需要的伪静态,以及我们新增的伪静态。

B站为其他程序创建

如果你的服务器是 Nginx

请设置以下的伪静态。此伪静态是您需要添加的伪静态,如果你网站本身有伪静态规则,请自行组合下列伪静态。
比如您的B站是opencart 那么你需要将您opencart的伪静态与下列伪静态组合。如果不会请复制我们提供的伪静态和您自己的网站的伪静态,发送给deepseek让ai给你组合吧。

				
					location / {
    	if (!-e $request_filename){
    		rewrite ^/create_payment/(.*)$ /security_gateway/gateway.php?action=create_payment last;
    		rewrite ^/search/(.*)$ /security_gateway/gateway.php?action=search last;
    		rewrite ^/comfirm/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 last;
    		rewrite ^/cancel/(.*)$ /security_gateway/gateway.php?action=cancel&pay_no=$1 last;
    		rewrite ^/return/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 last;
    		rewrite ^/checkout/(.*)$ /security_gateway/gateway.php?action=checkout&pay_no=$1 last;
    		rewrite ^/notify/(.*)$ /security_gateway/gateway.php?action=notify&pay_no=$1 last;
    	}
    }
				
			

如果你的服务器是Apache

请设置以下的伪静态。此伪静态是您需要添加的伪静态,如果你网站本身有伪静态规则,请自行组合下列伪静态。
比如您的B站是opencart 那么你需要将您opencart的伪静态与下列伪静态组合。如果不会请复制我们提供的伪静态和您自己的网站的伪静态,发送给deepseek让ai给你组合吧。

				
					<IfModule mod_rewrite.c>
    RewriteEngine On

    # Check if the requested file or directory exists
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    # Rewrite rules
    RewriteRule ^create_payment/(.*)$ /security_gateway/gateway.php?action=create_payment [L,QSA]
    RewriteRule ^search/(.*)$ /security_gateway/gateway.php?action=search [L,QSA]
    RewriteRule ^comfirm/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 [L,QSA]
    RewriteRule ^cancel/(.*)$ /security_gateway/gateway.php?action=cancel&pay_no=$1 [L,QSA]
    RewriteRule ^return/(.*)$ /security_gateway/gateway.php?action=return&pay_no=$1 [L,QSA]
    RewriteRule ^checkout/(.*)$ /security_gateway/gateway.php?action=checkout&pay_no=$1 [L,QSA]
    RewriteRule ^notify/(.*)$ /security_gateway/gateway.php?action=notify&pay_no=$1 [L,QSA]
    </IfModule>