commit
This commit is contained in:
@@ -33,6 +33,7 @@ use Money\Money;
|
||||
use Billplz\Client;
|
||||
use Http\Client\Common\HttpMethodsClient;
|
||||
use Http\Adapter\Guzzle7\Client as GuzzleHttpClient;
|
||||
use Http\Message\MessageFactory\GuzzleMessageFactory;
|
||||
|
||||
class ApiController extends Controller
|
||||
{
|
||||
@@ -121,7 +122,7 @@ class ApiController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function PembayaranEngine(Request $request)
|
||||
public function feepayment(Request $request)
|
||||
{
|
||||
|
||||
$arraycollection_id = array();
|
||||
@@ -162,30 +163,40 @@ class ApiController extends Controller
|
||||
);
|
||||
|
||||
$billcode = $response->toArray();
|
||||
$reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri);
|
||||
|
||||
foreach($array_payment as $index1=>$arraypay)
|
||||
{
|
||||
$previous_siri = Http::get(config('api.url') . '/api/online/transaction')->json();
|
||||
if($previous_siri){
|
||||
$nosiri = $previous_siri['nosiri'] + 1;
|
||||
}else{
|
||||
$nosiri = 1;
|
||||
}
|
||||
$resit = new Resit;
|
||||
$resit->user_id = $request->user_id;
|
||||
$resit->lelongbid_id = $request->lelongbid_id;
|
||||
$resit->reference_no = $reference_no;
|
||||
$resit->billplz_id = $billcode['id'];
|
||||
$resit->resit_type = 1;
|
||||
$resit->total_payment = $total_bayaran;
|
||||
$resit->save();
|
||||
|
||||
$reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri);
|
||||
// foreach($array_payment as $index1=>$arraypay)
|
||||
// {
|
||||
// $previous_siri = Http::get(config('api.url') . '/api/online/transaction')->json();
|
||||
// if($previous_siri){
|
||||
// $nosiri = $previous_siri['nosiri'] + 1;
|
||||
// }else{
|
||||
// $nosiri = 1;
|
||||
// }
|
||||
|
||||
$new_transaction = Http::post(config('api.url') . '/api/online/transaction',[
|
||||
'nokp'=> Auth::user()->icno,
|
||||
'reference_no'=> $reference_no,
|
||||
'nosiri'=> $nosiri,
|
||||
'billplz_id' => $billcode['id'],
|
||||
'norujukan' => $arraypay['norujukan'],
|
||||
'kodcaw' => $arraypay['kodcaw'],
|
||||
'total_payment'=> $arraypay['bayaran'],
|
||||
'customer_name' => Auth::user()->name,
|
||||
])->json();
|
||||
// $reference_no = 'LPKB' . $day . $month . $year . sprintf("%08d", $nosiri);
|
||||
|
||||
}
|
||||
// $new_transaction = Http::post(config('api.url') . '/api/online/transaction',[
|
||||
// 'nokp'=> Auth::user()->icno,
|
||||
// 'reference_no'=> $reference_no,
|
||||
// 'nosiri'=> $nosiri,
|
||||
// 'billplz_id' => $billcode['id'],
|
||||
// 'norujukan' => $arraypay['norujukan'],
|
||||
// 'kodcaw' => $arraypay['kodcaw'],
|
||||
// 'total_payment'=> $arraypay['bayaran'],
|
||||
// 'customer_name' => Auth::user()->name,
|
||||
// ])->json();
|
||||
|
||||
// }
|
||||
|
||||
|
||||
return redirect($billcode['url'] . '?auto_submit=true');
|
||||
|
||||
Reference in New Issue
Block a user