Closed robertnicjoo closed 6 years ago
no support hah?
anyone?
@robertnicjoo really sorry, didn't read this issue
You can use $rajaongkir->account();
to check your account type and if you want to add multiple courier, just separated courier code with :
. Ex : $courier = 'jne:tiki:post:jnt';
(jnt need pro account), hope this help
PS : Don't forget to read the wiki to more information about this packagemention me if you need help
@ncaneldiee thanks for respond anyway, but I made a better way rather that typing all the courier names (i guess),
Since we have couriers in our app config file separated by api types I've made array of my couriers and listed them in function,
Here is sample function for those might some day end up here:
public function indexajax(Request $request, $weight, $cityID) {
$rajaongkir = new Rajaongkir\Domestic('xxxxxxxxxxxxxxxxxxxxxxx');
$province = $rajaongkir->province();
$cori = $rajaongkir->courier('all'); //get all couriers (base on your domestic code it will retrieve it automatically)
$cori = []; // put them in array
$origin = 152; //Jakarta
$destination = $request->cityID;
$weight = $request->weight;
$courier = $cori; // get couriers array in your function loop
$cost = $rajaongkir->cost($origin, $destination, $weight, $courier);
return response()->json($cost);
}
the rest of it is huge JavaScript
coding, you can figure it out...
This demo is made by Pro API
,
Hi,
How can I get all couriers in pro account?
this is my function now but only able to get one courier at the moment:
PS:
please help me to get
account type
in my codefor this i had to change
Domestic.php
file.couldn't add my type base on documents of this package
Thanks.