Skip to content
Snippets Groups Projects
Commit a4d1f392 authored by Gundo Sifhufhi's avatar Gundo Sifhufhi
Browse files

Add admin input fields and store Client ID, Secret and Rates endpoint to DB

parent aad7d9ab
Branches
Tags
No related merge requests found
...@@ -374,11 +374,12 @@ class Customshipping extends AbstractCarrier implements CarrierInterface ...@@ -374,11 +374,12 @@ class Customshipping extends AbstractCarrier implements CarrierInterface
*/ */
private function getApiUrl(): string private function getApiUrl(): string
{ {
//return $this->getConfigData('api_url');
// return 'https://api.dev.ship.uafrica.com'; // return 'https://api.dev.ship.uafrica.com';
//Used for testing purposes only on localhost, since there is not endpoint to get magento rates to work with //Used for testing purposes only on localhost, since there is not endpoint to get magento rates to work with
//Basically, I am using the structure of the response from the uAfrica API to test the functionality of the module //Basically, I am using the structure of the response from the uAfrica API to test the functionality of the module
// return $this->getConfigData('rates_endpoint');
return 'https://8390956f-c00b-497d-8742-87b1d6305bd2.mock.pstmn.io/putrates'; return 'https://8390956f-c00b-497d-8742-87b1d6305bd2.mock.pstmn.io/putrates';
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</section> </section>
<section id="carriers" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> <section id="carriers" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="uafrica" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> <group id="uafrica" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>bobGo</label> <label>uAfrica</label>
<field id="version" translate="label" type="label" sortOrder="0" showInDefault="1" showInWebsite="0" showInStore="0"> <field id="version" translate="label" type="label" sortOrder="0" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Version</label> <label>Version</label>
...@@ -133,8 +133,21 @@ ...@@ -133,8 +133,21 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field> </field>
<field id="access_token" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0"> <field id="access_token" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
<label>BobGo Access Token</label> <label>uAfrica Access Token</label>
<comment>The Access token you received from BobGo</comment> <comment>The Access token you received from uAfrica</comment>
</field>
<field id="client_id" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
<label>uAfrica Client ID</label>
<comment>The Client ID you received from uAfrica</comment>
</field>
<field id="client_secret" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
<label>uAfrica Client Secret</label>
<comment>The Client Secret you received from uAfrica</comment>
</field>
<field id="rates_endpoint" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
<label>uAfrica Rates</label>
<comment>Rates at check out collection Endpoint</comment>
</field> </field>
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0"> <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment