使用方圆支付,对接一定要注意与对方客服及时沟通,确保你的账号,都申请通过的支付权限
一、申请注册,方圆官网https://ott.ca/,注册后,按照操作流程进行操作,会有专人与你对接的(提供中文服务)
二、开通后,客服会把账号资料等信息发送到你的邮箱,注意查收即可。
主要有一下参数:
OTT Pay Merchant ID商户号:
Merchant Name 商户名称:
Sign Key:
Merchant Code:
您的OTT Pay商户中心登录信息(可查看交易报告):
OTT Pay 商户中心网址:https://merchant.ottpay.com
登录名: 初始密码:
资料注意事项:
1、首先确认一下你申请的支付权限,是否审核通过,这个需要询问客服
2、微信支付,需要你自己申请微信开发平台账号,提供给对方appid资料
3、支付宝支付,需要提供一个官方网站, 对方会给你开通权限
4、银联支付,如果只是银联银行卡支付,只需要开发权限即可,如果需要支持mastercard 和visa支付,需要提供风控批准等资料
三、技术开发,官方开发文档https://docs.ottpay.com/top-page/
对方也会将开发文档以文件的形式,发送到你的邮箱。
1、支付开发时,返回的参数,已经提交的参数都需要用到官方指定的加解密方式,具体文档如下
加解密函数:官方文档 https://docs.ottpay.com/payment-api/appendix-a
//加密函数
public function encrypt($input, $key)
{
return base64_encode(openssl_encrypt($input, 'aes-128-ecb', $key, OPENSSL_RAW_DATA));
}
//解密函数
public function decrypt($sStr, $sKey)
{
return openssl_decrypt($sStr, 'aes-128-ecb', $sKey);
}
//curl
public function curl_post($data,$url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-length:'.strlen($data)));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['SERVER_NAME']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
$resp = curl_exec($ch);
curl_close($ch);
return $resp;
}
2、银联支付
官方文档:https://docs.ottpay.com/payment-api/in-app-union-pay-secure-pay/payment-request-api
/**
* Notes:获取银行卡支付参数
*/
public function bankPay($amount=0.01,$order_id='1212185151',$cc_number='11111111'){
$amount = bcmul($amount,100);//金额是以美分为单位
$server_url = 'https://frontapi.ottpay.com:443/processV3';//支付对接链接
$data_array = [
'orderId'=>