speed payment
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\TacExpressPayment;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
|
class TacExpressPaymentController extends Controller
|
||||||
|
{
|
||||||
|
public function generateTacExpressPayment(Request $request){
|
||||||
|
|
||||||
|
$currentDateTime = Carbon::now();
|
||||||
|
$expired_at = Carbon::now()->addMinutes(15);
|
||||||
|
|
||||||
|
TacExpressPayment::on('mysql7')->create([
|
||||||
|
'norujukan' => $request->norujukan,
|
||||||
|
'tac_no' => $request->otp_token,
|
||||||
|
'expired_at' => $expired_at
|
||||||
|
]);
|
||||||
|
|
||||||
|
// $mobileno = '6'.$request->mobileno;
|
||||||
|
$mobileno = '60189025461';
|
||||||
|
$messages = 'AR-RAHN PKB ' . $request->cawangan . ' : TAC: ' . $request->otp_token . ' ' . $currentDateTime . '. AR-RAHN CARELINE CENTRE 1300-22-4343';
|
||||||
|
|
||||||
|
$status = Http::get('http://gateway.onewaysms.com.au:10001/api.aspx',[
|
||||||
|
'apiusername' => 'APIQ4LP5EMKXM',
|
||||||
|
'apipassword' => 'APIQ4LP5EMKXM7CQOX',
|
||||||
|
'senderid' => 'INFO',
|
||||||
|
'mobileno' => $mobileno,
|
||||||
|
'message'=> $messages,
|
||||||
|
'languagetype'=> 1
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response($status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTacExpressPayment(Request $request){
|
||||||
|
$currentDateTime = Carbon::now();
|
||||||
|
$tac_data = TacExpressPayment::on('mysql7')->where([['norujukan',$request->norujukan],['expired_at','>',$currentDateTime]])->get();
|
||||||
|
|
||||||
|
if(sizeof($tac_data) > 0){
|
||||||
|
return response(1);
|
||||||
|
}else{
|
||||||
|
return response(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function verifyTacExpressPayment(Request $request){
|
||||||
|
$currentDateTime = Carbon::now();
|
||||||
|
$tac_data = TacExpressPayment::on('mysql7')->where([['norujukan',$request->norujukan],['tac_no',$request->tac_token],['expired_at','>',$currentDateTime]])->get();
|
||||||
|
|
||||||
|
if(sizeof($tac_data) > 0){
|
||||||
|
return response(1);
|
||||||
|
}else{
|
||||||
|
return response(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class TacExpressPayment extends Model
|
||||||
|
{
|
||||||
|
protected $table = 'tac_express_payment';
|
||||||
|
public $timestamps = false;
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'norujukan','expired_at','tac_no'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes excluded from the model's JSON form.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
// protected $hidden = [];
|
||||||
|
}
|
||||||
@@ -417,6 +417,11 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
|
|
||||||
//Collection ID Billplz
|
//Collection ID Billplz
|
||||||
$router->get('billplz/collectionid',['uses'=>'PortalBillplzController@getCollectionIDCawangan']);
|
$router->get('billplz/collectionid',['uses'=>'PortalBillplzController@getCollectionIDCawangan']);
|
||||||
|
|
||||||
|
//Generate TAC Express Payment
|
||||||
|
$router->post('tac/generate/express_payment',['uses'=>'TacExpressPaymentController@generateTacExpressPayment']);
|
||||||
|
$router->get('tac/get/express_payment',['uses'=>'TacExpressPaymentController@getTacExpressPayment']);
|
||||||
|
$router->get('tac/verify/express_payment',['uses'=>'TacExpressPaymentController@verifyTacExpressPayment']);
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->group(['prefix'=>'e-arrahn'], function () use ($router){
|
$router->group(['prefix'=>'e-arrahn'], function () use ($router){
|
||||||
|
|||||||
Reference in New Issue
Block a user