快手接入流程
添加链接描述
快手微信支付
public function get_pay_kuaishou()
{
$price =100;
$nonce_str = "1234556nnnn";//支付单号
$wxurl = $this->wxpay($nonce_str, $price);
if ($wxurl['status'] == 0) {
return $this->jsonData(0, $wxurl['msg']);
}
$time = $this->get_total_millisecond();//下单时间 unix 时间戳戳,精确到毫秒
$arr = [
'app_id' => "ks********", //快手appid
'sign_type' => 'MD5', //定死的别动!!!
'timestamp' => strval($time), //需要为字符串类型的时间戳
'version' => '1.0', //定死的别动!!!
'trade_type' => 'H5', //定死的别动!!!
'product_code' => 'pay', //定死的别动!!!
'out_order_no' => strval($nonce_str), //自定义的订单号
'total_amount' => $price * 100, //金额 这里单位:分
'currency' => 'CNY', //定死的别动!
'subject' => "快手商家支付", //之前定好的标题
'body' => "快手商家支付", //之前定好的内容
'trade_time' => strval($time), //一定要和 上面的 timestamp 字段相同
'valid_time' => '60', //测试留的时间长
];
$arr['wx_url'] = $wxurl['arr']['MWEB_URL'];
$arr['wx_type'] = "MWEB";
$stringToBeSigned = $this->getSignContent($arr); //这里待签名处理.方法下面
$sign = md5