예제 #1
0
 public function getAccountByMemberId($memberId = 0)
 {
     try {
         $da = Model_Payment_JpPayAccount::data_access();
         $result = $da->filter('member_id', $memberId)->find_one();
         return $result->account;
     } catch (Exception $e) {
     }
     return false;
 }
예제 #2
0
 public static function getAccountByBrokerId($brokerId)
 {
     try {
         $dc = Model_Payment_JpPayAccount::data_access();
         $dcRes = $dc->filter('member_id', $brokerId)->find_one();
         return $dcRes;
     } catch (Exception $e) {
         return array();
     }
 }
예제 #3
0
 public function createJpAccountId($jpBrokerId)
 {
     $propSpread = APF::get_instance()->get_config("propSpread_jp", "app");
     $host = APF::get_instance()->get_config("paycenter_api", "paycenter_services");
     $strCallURL = $host . "interfaces/?appid=" . $propSpread['paycenter_id'] . "&appkey=" . $propSpread['paycenter_key'] . "&uid=" . $jpBrokerId . "&action=create";
     $arrCallback = Util_API::getData($strCallURL, array(), 'json', 0, 3, 3);
     APF::get_instance()->debug($strCallURL);
     APF::get_instance()->debug($arrCallback);
     if ($arrCallback) {
         $modelJpUserAccount = new Model_Payment_JpPayAccount();
         $modelJpUserAccount->member_id = $jpBrokerId;
         $modelJpUserAccount->account = $arrCallback['account'];
         $modelJpUserAccount->create_time = date("Y-m-d H:i:s");
         $modelJpUserAccount->save();
         return intval($arrCallback['account']);
     } else {
         return false;
     }
 }