| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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']);
- }
- }
-
-
-
-
- }
|