| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- namespace backend\models;
- class PayApi extends BaseApi
- {
- public $apiUrl = 'pay';
- /**
- * 支付
- * @param array $data
- * @return array
- */
- public function outPay($data)
- {
- $result = $this->post($this->apiUrl . '/outpay', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], 'OK');
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
- /**
- * 异步回调
- * @param array $data
- * @param int $payType
- * @return array
- */
- public function callNotify($data, $payType)
- {
- !isset($data['payType']) && $data['payType'] = $payType;
- $result = $this->post($this->apiUrl . '/notify', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, $result['data'], $result['message']);
- }
- }
- /**
- * 同步回调
- * @param array $data
- * @param int $payType
- * @return array
- */
- public function callReturn($data, $payType)
- {
- !isset($data['payType']) && $data['payType'] = $payType;
- $result = $this->post($this->apiUrl . '/return', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, $result['data'], $result['message']);
- }
- }
-
-
-
-
- /**
- * 更新銀行數據庫的金額
- * @param array $data
- * @return array
- */
- public function callUpdata($data)
- {
- $result = $this->post($this->apiUrl . '/updata', $data); //发起请求
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, $result['data'], $result['message']);
- }
- }
- /**
- * 获取銀行數據庫的金額
- * @param array $data
- * @return array
- */
- public function callGetmoney($data)
- {
- $result = $this->post($this->apiUrl . '/getmoney', $data); //发起请求
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, $result['data'], $result['message']);
- }
- }
-
-
-
-
- }
|