fix api email
This commit is contained in:
@@ -28,15 +28,15 @@ class BayaranController extends Controller
|
||||
$this->api_key = 'f3e82fe1-a422-4660-97f0-65cc59ff6c47';
|
||||
$this->XSignature_Key = 'S-alZUbzmD2_TF3vmrRqgehQ';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function SenaraiPembayaran()
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
$belum_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json();
|
||||
|
||||
if(is_array($belum_tebus))
|
||||
{
|
||||
@@ -45,7 +45,7 @@ class BayaranController extends Controller
|
||||
$belum_tebus = $belum_tebus[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// return view('pembayaran.senaraibayaran', compact('belum_tebus'));
|
||||
return view('includes.bayaran.senaraibayaransag', compact('belum_tebus'));
|
||||
@@ -54,7 +54,7 @@ class BayaranController extends Controller
|
||||
public function PembayaranAction(Request $request)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$validated = $request->validate([
|
||||
'chkboxsag' => 'required',
|
||||
]);
|
||||
@@ -63,7 +63,7 @@ class BayaranController extends Controller
|
||||
|
||||
foreach($request->chkboxsag as $index=>$sag)
|
||||
{
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $sag)->json();
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $sag)->json();
|
||||
|
||||
$arraybayar[] = $gadai[0][0];
|
||||
}
|
||||
@@ -80,11 +80,11 @@ class BayaranController extends Controller
|
||||
// dd($request);
|
||||
// foreach($request->txtnorujukanhidden as $index1=>$norujukan)
|
||||
// {
|
||||
// // $updategadai = Http::put(config('api.url').'/api/gadai/'. $request->txtkodcawhidden[$index1] .'/norujukan/' . $norujukan,[
|
||||
// // $updategadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/'. $request->txtkodcawhidden[$index1] .'/norujukan/' . $norujukan,[
|
||||
// // 'bayaran' => $request->txtbayaranhidden[$index1]
|
||||
// // ])->json();
|
||||
|
||||
|
||||
|
||||
|
||||
// array_push($arraybayaran,['norujukan' => $norujukan, 'kodcaw' => $request->txtkodcawhidden[$index1], 'bayaran' => $request->txtbayaranhidden[$index1]]);
|
||||
// }
|
||||
|
||||
@@ -94,7 +94,7 @@ class BayaranController extends Controller
|
||||
new GuzzleHttpClient(),
|
||||
new GuzzleMessageFactory()
|
||||
);
|
||||
|
||||
|
||||
$billplz = new Client($http, $this->api_key);
|
||||
if(config('app.env') != 'production'){
|
||||
$billplz->useSandbox();
|
||||
@@ -126,7 +126,7 @@ class BayaranController extends Controller
|
||||
{
|
||||
array_push($array_payment,['customer_name' => Auth::user()->name,'nokp' => Auth::user()->icno,'kodcaw'=>$request->txtkodcawhidden[$index1],'norujukan'=>$norujukan,'bayaran'=>$request->txtbayaranhidden[$index1]]);
|
||||
}
|
||||
|
||||
|
||||
$total_bayaran += $request->txtbayaranhidden[$index1];
|
||||
}
|
||||
|
||||
@@ -141,13 +141,13 @@ class BayaranController extends Controller
|
||||
if(config('app.env') != 'production'){
|
||||
$collection_id = $this->collection_id;
|
||||
}else{
|
||||
$collection_id = Http::get(config('api.url'). '/api/billplz/collectionid',[
|
||||
$collection_id = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/billplz/collectionid',[
|
||||
'kodcaw' => $kodcaw
|
||||
])->json();
|
||||
])->json();
|
||||
}
|
||||
array_push($arraycollection_id,$collection_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$response = $bill->create(
|
||||
$collection_id,
|
||||
@@ -164,7 +164,7 @@ class BayaranController extends Controller
|
||||
|
||||
foreach($array_payment as $index1=>$arraypay)
|
||||
{
|
||||
$previous_siri = Http::get(config('api.url') . '/api/online/transaction')->json();
|
||||
$previous_siri = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/online/transaction')->json();
|
||||
if($previous_siri){
|
||||
$nosiri = $previous_siri['nosiri'] + 1;
|
||||
}else{
|
||||
@@ -173,7 +173,7 @@ class BayaranController extends Controller
|
||||
|
||||
$reference_no = 'APKB' . $day . $month . $year . sprintf("%08d", $nosiri);
|
||||
|
||||
$new_transaction = Http::post(config('api.url') . '/api/online/transaction',[
|
||||
$new_transaction = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/online/transaction',[
|
||||
'nokp'=> Auth::user()->icno,
|
||||
'reference_no'=> $reference_no,
|
||||
'nosiri'=> $nosiri,
|
||||
@@ -185,7 +185,7 @@ class BayaranController extends Controller
|
||||
])->json();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return redirect($billcode['url'] . '?auto_submit=true');
|
||||
|
||||
@@ -198,37 +198,37 @@ class BayaranController extends Controller
|
||||
|
||||
$kpbaru = Auth::User()->icno;
|
||||
|
||||
$customer = Http::get(config('api.url') .'/api/customers/'.$kpbaru)->json();
|
||||
$customer = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/customers/'.$kpbaru)->json();
|
||||
$customer_details = $customer;
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$date = $current->toDateTimeString();
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $payment_details['kodcaw'])->json();
|
||||
$cawangan = Http::get(config('api.url') . '/api/cawangan/detail/'. $payment_details['kodcaw'])->json();
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $payment_details['kodcaw'])->json();
|
||||
$cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/detail/'. $payment_details['kodcaw'])->json();
|
||||
$cawangan_detail = $cawangan[0];
|
||||
$nama_cawangan = $cawangan_info['details_caw'];
|
||||
|
||||
$gadai_details = Http::get(config('api.url') .'/api/gadai/norujukan/'.$payment_details['norujukan'])->json();
|
||||
|
||||
$gadai_details = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/gadai/norujukan/'.$payment_details['norujukan'])->json();
|
||||
$gadai = $gadai_details[0][0];
|
||||
// if($gadai_details[0][0]['hargajualan'] > 0)
|
||||
// {
|
||||
// $baki_harga_jualan_sebelum = $gadai_details[0][0]['bakihargajualan'] + $payment_details['total_payment'];
|
||||
// $baki_harga_jualan_semasa = $gadai_details[0][0]['bakihargajualan'];
|
||||
|
||||
|
||||
return view('pembayaran.resit.resitportal',compact('customer_details','payment_details','cawangan_detail','nama_cawangan','gadai'));
|
||||
// }else{
|
||||
|
||||
// $gadai_details = $gadai_details[0][0];
|
||||
|
||||
// $koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $payment_details['kodcaw'] . '/' . $payment_details['norujukan'])->json();
|
||||
// $koskeuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahbukantawarruq/' . $payment_details['kodcaw'] . '/' . $payment_details['norujukan'])->json();
|
||||
|
||||
// $jbg = $gadai_details['jbg'];
|
||||
|
||||
|
||||
// return view('pembayaran.resit.resit_baru_sebelum',compact('customer_details','payment_details','date','koskeuntungan','jbg'));
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ class BayaranController extends Controller
|
||||
new GuzzleHttpClient(),
|
||||
new GuzzleMessageFactory()
|
||||
);
|
||||
|
||||
|
||||
$billplz = new Client($http, $this->api_key);
|
||||
if(config('app.env') != 'production'){
|
||||
$billplz->useSandbox();
|
||||
@@ -247,24 +247,24 @@ class BayaranController extends Controller
|
||||
$bill = $billplz->bill();
|
||||
|
||||
$data = $bill->webhook($request->toArray());
|
||||
|
||||
|
||||
if($data['billplz']['paid'] == 'true'){
|
||||
Http::put(config('api.url') . '/api/online/transaction',[
|
||||
Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url') . '/api/online/transaction',[
|
||||
'billplz_id' => $data['billplz']['id'],
|
||||
'status' => 'PAID',
|
||||
'paid_at' => $data['billplz']['paid_at']
|
||||
]);
|
||||
|
||||
$transactionOnline = Http::get(config('api.url') . '/api/transaction/online/express',[
|
||||
$transactionOnline = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/online/express',[
|
||||
'billplz_id' => $data['billplz']['id']
|
||||
])->json();
|
||||
|
||||
return redirect()->route('pay.success',[
|
||||
'transactionOnline' => $transactionOnline
|
||||
]);
|
||||
|
||||
|
||||
}else{
|
||||
Http::put(config('api.url') . '/api/online/transaction',[
|
||||
Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url') . '/api/online/transaction',[
|
||||
'billplz_id' => $data['billplz']['id'],
|
||||
'status' => 'UNSUCCESSFUL',
|
||||
'paid_at' => null
|
||||
@@ -278,7 +278,7 @@ class BayaranController extends Controller
|
||||
new GuzzleHttpClient(),
|
||||
new GuzzleMessageFactory()
|
||||
);
|
||||
|
||||
|
||||
$billplz = new Client($http, $this->api_key);
|
||||
if(config('app.env') != 'production'){
|
||||
$billplz->useSandbox();
|
||||
@@ -289,22 +289,22 @@ class BayaranController extends Controller
|
||||
|
||||
$data = $bill->webhook($request->toArray());
|
||||
if($data['billplz']['paid'] == 'true'){
|
||||
Http::put(config('api.url') . '/api/online/transaction',[
|
||||
Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url') . '/api/online/transaction',[
|
||||
'billplz_id' => $data['billplz']['id'],
|
||||
'status' => 'PAID',
|
||||
'paid_at' => $data['billplz']['paid_at']
|
||||
]);
|
||||
|
||||
$transactionOnline = Http::get(config('api.url') . '/api/transaction/online/login',[
|
||||
$transactionOnline = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/online/login',[
|
||||
'billplz_id' => $data['billplz']['id']
|
||||
])->json();
|
||||
|
||||
return redirect()->route('pay.success',[
|
||||
'transactionOnline' => $transactionOnline
|
||||
]);
|
||||
|
||||
|
||||
}else{
|
||||
Http::put(config('api.url') . '/api/online/transaction',[
|
||||
Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url') . '/api/online/transaction',[
|
||||
'billplz_id' => $data['billplz']['id'],
|
||||
'status' => 'UNSUCCESSFUL',
|
||||
'paid_at' => null
|
||||
@@ -323,21 +323,21 @@ class BayaranController extends Controller
|
||||
// dd($transactionOnline);
|
||||
foreach($transactionOnline as $index1=>$trans)
|
||||
{
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $trans['kodcaw'])->json();
|
||||
$cawangan = Http::get(config('api.url') . '/api/cawangan/detail/'. $trans['kodcaw'])->json();
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $trans['kodcaw'])->json();
|
||||
$cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/detail/'. $trans['kodcaw'])->json();
|
||||
$cawangan_detail = $cawangan[0];
|
||||
$nama_cawangan = $cawangan_info['details_caw'];
|
||||
$gadai = Http::get(config('api.url') .'/api/gadai/norujukan/'.$trans['norujukan'])->json();
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/gadai/norujukan/'.$trans['norujukan'])->json();
|
||||
$gadai = $gadai[0][0];
|
||||
|
||||
array_push($arraygadai,$gadai);
|
||||
array_push($arraycawangan,$cawangan_detail);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dd($arraygadai,$arraycawangan);
|
||||
|
||||
|
||||
// return view('pembayaran.result.berjaya',compact('transactionOnline','arraycawangan','arraygadai'));
|
||||
return view('pembayaran.result.berjayaportal',compact('transactionOnline','arraycawangan','arraygadai'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user