Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hi,
I'm new on Shopify apps. I'hv created a custom app that installs on shopify store admin and creates a custom service carrier. The carrier is added succesfully but the service's call back URL is not fetching rates from the file. here is the code:
New Carrier Code (It is working fine and carrier is created succesfully):
$new_carrier = array(
"carrier_service" => array(
"name" => 'Custom Shipping Rate Provider',
"callback_url" => 'http://abc.local/dummy_service_callback.php',
"service_discovery" => true
)
);
Callback URL file Code:
$carrier_services = [
[
'service_name' => 'Custom Shipping Rate 1',
'service_code' => 'custom_rate_1',
'total_price' => 10.00,
'currency' => 'USD',
'description' => 'All description is available...'
],
[
'service_name' => 'Custom Shipping Rate 2',
'service_code' => 'custom_rate_2',
'total_price' => 20.00,
'currency' => 'USD',
'description' => 'All description is available...'
]
];
$callback_response = [
'rates' => $carrier_services
];
header('Content-Type: application/json');
echo json_encode($callback_response);
I have added both of these URLs in the "Allowed redirection URL(s)" of the 'app setup'
http://abc.local/generate_token.php
http://abc.local/dummy_service_callback.php
1 - I am checking this on the development store
2 - The abc.local is my local machine, so the app code is on my local machine.
Need you people's suggestion, why the callback URL is not showing rates on the checkout
Thanks a lot.
Hi, can anyone mention what is the possible solution of issue or where I have done wrong,
Thanks
sir, have you got the problem resolved? I have the exact same issue here. If you have a fix, please share. Thanks.