ระบบตัดบัตร TrueMoney ใช้ไฟล์ class ไฟล์เดียว ( TrueMoney Wallet )

เริ่มโดย xindy, 06 มิถุนายน 2017, 22:48:34

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

xindy

ระบบตัดบัตร TrueMoney ใช้ไฟล์ class ไฟล์เดียว ( TrueMoney Wallet ) ไม่ผ่านตัวกลางของใครทั้งนั้นเข้าตรงกระเป๋าเลยครับ
( PHP )
Update Code 9/6/2560

class TrueWallet{
public  $username;
public  $password;
private $passhash;
//Config TrueWallet ห้ามแก้ไขหากไม่รู้ค่าที่แท้จริง
private $login_type = "email";
private $api_signin = "https://api-ewm.truemoney.com/api/v1/signin?&";
private $api_profile = "https://api-ewm.truemoney.com/api/v1/profile/";
private $api_topup = "https://api-ewm.truemoney.com/api/api/v1/topup/mobile/";
private $device_os = "android";
private $device_id = "d520d0d12d0d48cb89394905168c6ed5";
private $device_type = "CPH1611";
private $device_version = "6.0.1";
private $app_name = "wallet";
private $app_version = "2.9.14";
private $deviceToken = "fUUbZJ9nwBk:APA91bHHgBBHhP9rqBEon_BtUNz3rLHQ-sYXnezA10PRSWQTwFpMvC9QiFzh-CqPsbWEd6x409ATC5RVsHAfk_-14cSqVdGzhn8iX2K_DiNHvpYfMMIzvFx_YWpYj5OaEzMyIPh3mgtx";
private $mobileTracking = "dJyFzn\/GIq7lrjv2RCsZbphpp0L\/W2+PsOTtOpg352mgWrt4XAEAAA==";
//End Config

public function __construct($user,$pass) {
$this->username = $user;
$this->password = $pass;
$this->passhash = sha1($user.$pass);
}

public function GetToken(){
$url = $this->api_signin.'device_os='.$this->device_os.'&device_id='.$this->device_id.'&device_type='.$this->device_type.'&device_version='.$this->device_version.'&app_name='.$this->app_name.'&app_version='.$this->app_version;
$header = array(
"Host: api-ewm.truemoney.com",
"Content-Type: application/json"
);
$postfield = array(
"username"=>$this->username,
"password"=>$this->passhash,
"type"=>$this->login_type,
"deviceToken"=>$this->deviceToken,
"mobileTracking"=>$this->mobileTracking,
);
$data_string = json_encode($postfield);

return $this->wallet_curl($url,$data_string,$header);
}

public function Profile($token){
$url = $this->api_profile.$token.'?&device_os=android&device_id='.$this->device_id.'&device_type='.$this->device_type.'&device_version='.$this->device_version.'&app_name='.$this->app_name.'&app_version='.$this->app_version;
$header = array("Host: api-ewm.truemoney.com");
return $this->wallet_curl($url,false,$header);

}

public function Topup($cashcard,$token){
$url = $this->api_topup.time()."/".$token."/cashcard/".$cashcard;
$header = array("Host: api-ewm.truemoney.com");
return $this->wallet_curl($url,true,$header);
}

private function wallet_curl($url,$data,$header){
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);  
if($data){
curl_setopt($ch,CURLOPT_CUSTOMREQUEST, "POST");                                                                    
curl_setopt($ch,CURLOPT_POSTFIELDS, $data);        
}                                  
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);  
curl_setopt($ch,CURLOPT_USERAGENT,'');
$result = curl_exec($ch);
return $result;
}
}


$wallet = new TrueWallet('YOUR EMAIL','YOUR PASSWORD');
$token = json_decode($wallet->GetToken(),true)['data']['accessToken'];
$profile = $wallet->Profile($token);
$topup = $wallet->Topup('เลขบบัตรทรูมั่นนี่',$token);

Download https://github.com/exzajung/class.truewallet.php
ทดสอบได้ที่ https://www.xindy.in/truewallet
เข้าตรวจสอบผ่านเว็บ https://wallet.truemoney.com/ หรือจะเช็คที่แอพก็ได้นะครับ

เพิ่มเติม https://github.com/xeleniumz/TrueWallet
TrueWallet

TrueWallet library For Node.js
PHP Version & Credit

visit this repository for php version https://github.com/exzajung/class.truewallet.php
System requirement

   babel transpiler
   node.js version 7.10 or higher
   request-promise-native Simplified HTTP request client for node.js package
   moment time management time management for node.js package

How to use

   install require package
   import this library to your controller
   send request data with post to endpoint and Enjoy !!

Debugging

There are at least three ways to debug the operation of request: Launch the node process like NODE_DEBUG=request node script.js (lib,request,otherlib works too). Set require('request').debug = true at any time Use the request-debug module to view request and response headers and bodies.

wasantec

ใช้ดีไหมครับ มาเนียนขายหรือว่ายังไง  :wanwan019:


superjak



nutlove

มีประโยชน์มากครับ เอาไปประยุกใช้ได้เยอะเลยทีเดียว ขอบพระคุณมากครับ +1  :wanwan020:
VPS , Colocation , Dedicated รับเขียนเว็บไซต์
ChangHost.co /Cloud VPS SSD เพียงวันละ 10บาท   คลิก 
VPS เริ่มต้นที่ 260 บาท ถูกที่สุดในไทย (CPU4CoreRAM5GB)  คลิก 
รับทำเว็บราคาถูก.com

xindy

อ้างถึงจาก: wasantec ใน 06 มิถุนายน 2017, 23:52:35
ใช้ดีไหมครับ มาเนียนขายหรือว่ายังไง  :wanwan019:

maneemeena

เข้าไปดูที่ github ไม่มีอะไรเลยครับ ลบแล้วหรือครับ???

xindy


ANALOGY

เติม TrueMoney => เก็บค่าลงDB => แสดงผล (True,False) => ที่เหลือจะเอาไปประยุกต์เป็น VIP หรืออะไรก็ได้เนอะง่ายดี  :wanwan007:

maneemeena

อ้างถึงจาก: xindy ใน 07 มิถุนายน 2017, 09:16:24
กำลังแก้ไข code ใหม่ครับ
ผมก็ว่าโค้ดมันแปลกๆ เลยเอามาปรับปรุงหน่อย ใช้ได้เลยครับ เหลือแค่ลองเติมเงิน  :wanwan020: :wanwan020: :wanwan020:

tanutsun


AbuseMan

█ [direct=https://radio.sukson.com]ฟังเพลงออนไลน์[/direct] : เว็บเพลงออนไลน์ที่คุณขอฟังเพลงได้ด้วยตัวคุณเอง
█ [direct=https://chat.sukson.com]ห้องแชท[/direct] : บริการฟรีห้องแชทสำหรับติดเว็บ
█ [direct=https://music.sukson.com]เพลงใหม่[/direct] : เพลงใหม่ เพลงฮิต
█ [direct=https://bankumka.com]บ้านคุ้มค่า[/direct] : ลงประกาศขายบ้าน ที่ดิน พร้อมอัพเดทโครงการบ้านและคอนโดใหม่ที่น่าสนใจ

xindy

ปรับปรุงเสร็จส่งกลับมาให้ชมบ้างนะครับ  :-[
อ้างถึงจาก: maneemeena ใน 07 มิถุนายน 2017, 09:38:35
อ้างถึงจาก: xindy ใน 07 มิถุนายน 2017, 09:16:24
กำลังแก้ไข code ใหม่ครับ
ผมก็ว่าโค้ดมันแปลกๆ เลยเอามาปรับปรุงหน่อย ใช้ได้เลยครับ เหลือแค่ลองเติมเงิน  :wanwan020: :wanwan020: :wanwan020:


G1

[direct=https://goo.gl/9jmoQX]RDP Windows สำหรับอัพโหลดไฟล์ เร็วมากๆ เริ่มที่ต้นที่ $3.99 / เดือน[/direct]
[direct=https://bit.ly/3js5C4w]ค่าธรรมเนียมลดลง 10% เมื่อเทรด Cryptocurrency bitcoin กับ Binance[/direct]

thaigopher

รับปรึกษา เรื่องสตรีมมิ่ง
รับปรึกษาเรื่องถ่ายทอดสด
ให้เช่าเซิฟเวอร์ถ่ายทอดสด
บริการ WowzaStreaming แบบรายเดือนพร้อมเซิฟเวอร์
สามารถขอทดลองใช้ได้
ติดต่อ id line:gopherth
โทร:0954984333

maneemeena

อ้างถึงจาก: xindy ใน 07 มิถุนายน 2017, 10:38:00
ปรับปรุงเสร็จส่งกลับมาให้ชมบ้างนะครับ  :-[
อ้างถึงจาก: maneemeena ใน 07 มิถุนายน 2017, 09:38:35
อ้างถึงจาก: xindy ใน 07 มิถุนายน 2017, 09:16:24
กำลังแก้ไข code ใหม่ครับ
ผมก็ว่าโค้ดมันแปลกๆ เลยเอามาปรับปรุงหน่อย ใช้ได้เลยครับ เหลือแค่ลองเติมเงิน  :wanwan020: :wanwan020: :wanwan020:


PM ไปให้แล้วครับ


affsom


Magic00

น่าสนใจมากครับ แต่ผมไม่เก่งเรื่องโค้ดเอาสะเลย  :'(
ถ้าความสามารถเรายังเท่าเดิม รายได้ไม่เพิ่มแน่นอน