Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgo-magento-extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgo-magento-extension
Commits
a4d1f392
Commit
a4d1f392
authored
2 years ago
by
Gundo Sifhufhi
Browse files
Options
Downloads
Patches
Plain Diff
Add admin input fields and store Client ID, Secret and Rates endpoint to DB
parent
aad7d9ab
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
uafrica/Customshipping/Model/Carrier/Customshipping.php
+2
-1
2 additions, 1 deletion
uafrica/Customshipping/Model/Carrier/Customshipping.php
uafrica/Customshipping/etc/adminhtml/system.xml
+16
-3
16 additions, 3 deletions
uafrica/Customshipping/etc/adminhtml/system.xml
with
18 additions
and
4 deletions
uafrica/Customshipping/Model/Carrier/Customshipping.php
+
2
−
1
View file @
a4d1f392
...
@@ -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'
;
}
}
...
...
This diff is collapsed.
Click to expand it.
uafrica/Customshipping/etc/adminhtml/system.xml
+
16
−
3
View file @
a4d1f392
...
@@ -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"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment