private function convertParams($params) { $converted = array(); $converted['_input_charset'] = 'utf-8'; $converted['partner'] = $this->options['key']; $converted['trade_role'] = 'B'; $converted['sign_type'] = 'MD5'; $converted['out_order_no'] = $params['sn']; $converted['service'] = 'close_trade'; $converted['sign'] = CommonUtil::signParams($converted, $this->options['secret']); return $converted; }
protected function convertParams($params) { $converted = array(); $converted['appid'] = $this->options['key']; $converted['attach'] = '支付'; $converted['body'] = mb_substr($this->filterText($params['title']), 0, 49, 'utf-8'); $converted['mch_id'] = $this->options["wxpay_account"]; $converted['nonce_str'] = $this->getNonceStr(); $converted['notify_url'] = $params['notifyUrl']; $converted['out_trade_no'] = $params['orderSn']; $converted['spbill_create_ip'] = $this->getClientIp(); $converted['total_fee'] = intval($params['amount'] * 100); $converted['trade_type'] = 'NATIVE'; $converted['product_id'] = $params['orderSn']; $converted['sign'] = strtoupper(CommonUtil::signParams($converted, '&key=' . $this->options['secret'])); return $converted; }
protected function convertParams($params) { $converted = array(); if ($this->getPaymentType() == 'dualfun') { $converted['service'] = 'trade_create_by_buyer'; } elseif ($this->getPaymentType() == 'escow') { $converted['service'] = 'create_partner_trade_by_buyer'; } else { $converted['service'] = 'create_direct_pay_by_user'; } $converted['partner'] = $this->options['key']; $converted['payment_type'] = 1; $converted['_input_charset'] = 'utf-8'; $converted['sign_type'] = 'MD5'; $converted['out_trade_no'] = $params['orderSn']; $converted['subject'] = $this->filterText($params['title']); $converted['seller_id'] = $this->options['key']; if (in_array($this->getPaymentType(), array('dualfun', 'escow'))) { $converted['price'] = $params['amount']; $converted['quantity'] = 1; $converted['logistics_type'] = 'POST'; $converted['logistics_fee'] = '0.00'; $converted['logistics_payment'] = 'BUYER_PAY'; } else { $converted['total_fee'] = $params['amount']; } if (!empty($params['notifyUrl'])) { $converted['notify_url'] = $params['notifyUrl']; } if (!empty($params['returnUrl'])) { $converted['return_url'] = $params['returnUrl']; } if (!empty($params['showUrl'])) { $converted['show_url'] = $params['showUrl']; } if (!empty($params['summary'])) { $converted['body'] = $this->filterText($params['summary']); } $converted['sign'] = CommonUtil::signParams($converted, $this->options['secret']); return $converted; }
private function signParams($params) { return CommonUtil::signParams($params, $this->options['secret']); }