Skip to content

Commit

Permalink
Merge pull request #2 from PrestaShopCorp/feat/mock_essential_api
Browse files Browse the repository at this point in the history
mock other ps_accounts essential api
  • Loading branch information
Clap404 committed Mar 6, 2024
2 parents b7b89b9 + 92b8542 commit df85aec
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
composer.phar
dist/
vendor/
vendor/
.idea
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: help clean build version zip
VERSION ?= v1.0.0
VERSION ?= v1.0.1
MODULE = ps_accounts
PACKAGE ?= ${MODULE}_mock-${VERSION}

Expand Down
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<module>
<name>ps_accounts</name>
<displayName><![CDATA[PrestaShop Accounts Mock]]></displayName>
<version><![CDATA[1.0.0]]></version>
<version><![CDATA[1.0.1]]></version>
<description><![CDATA[PS Accounts Mock.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
<confirmUninstall><![CDATA[Do you want to get rid of this mock?]]></confirmUninstall>
<is_configurable>0</is_configurable>
<need_instance>0</need_instance>
</module>
</module>
8 changes: 8 additions & 0 deletions config/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ services:
PrestaShop\Module\PsAccounts\Service\PsAccountsService:
class: PrestaShop\Module\PsAccounts\Service\PsAccountsService
public: true

PrestaShop\Module\PsAccounts\Presenter\PsAccountsPresenter:
class: PrestaShop\Module\PsAccounts\Presenter\PsAccountsPresenter
public: true

PrestaShop\Module\PsAccounts\Repository\UserTokenRepository:
class: PrestaShop\Module\PsAccounts\Repository\UserTokenRepository
public: true
16 changes: 16 additions & 0 deletions src/Presenter/PsAccountsPresenter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace PrestaShop\Module\PsAccounts\Presenter;

class PsAccountsPresenter
{
public function __construct()
{
}

public function present($name)
{
return $name;
}

}
15 changes: 15 additions & 0 deletions src/Repository/UserTokenRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace PrestaShop\Module\PsAccounts\Repository;

class UserTokenRepository
{
public function __construct()
{
}

public function getOrRefreshToken()
{
return 'token';
}
}
10 changes: 10 additions & 0 deletions src/Service/PsAccountsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public function getShopUuid()
return 'f07181f7-2399-406d-9226-4b6c14cf6068';
}

public function getShopUuidV4()
{
return $this->getShopUuid();
}

public function getOrRefreshToken()
{
return 'eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOTczZWUwZTE2ZjdlZWY0ZjkyMWQ1MGRjNjFkNzBiMmVmZWZjMTkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vcHJlc3Rhc2hvcC1yZWFkeS1wcm9kIiwiYXVkIjoicHJlc3Rhc2hvcC1yZWFkeS1wcm9kIiwiYXV0aF90aW1lIjoxNjc5MDY1NzE0LCJ1c2VyX2lkIjoiZjA3MTgxZjctMjM5OS00MDZkLTkyMjYtNGI2YzE0Y2Y2MDY4Iiwic3ViIjoiZjA3MTgxZjctMjM5OS00MDZkLTkyMjYtNGI2YzE0Y2Y2MDY4IiwiaWF0IjoxNjc5MDY1NzE0LCJleHAiOjE2NzkwNjkzMTQsImVtYWlsIjoiaHR0cGM4MTg4ODE2Mjc1NjVldW5ncm9raW8xQHNob3AucHJlc3Rhc2hvcC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZmlyZWJhc2UiOnsiaWRlbnRpdGllcyI6eyJlbWFpbCI6WyJodHRwYzgxODg4MTYyNzU2NWV1bmdyb2tpbzFAc2hvcC5wcmVzdGFzaG9wLmNvbSJdfSwic2lnbl9pbl9wcm92aWRlciI6ImN1c3RvbSJ9fQ.mbv_nY6rmz_OpfN32CyvsTa-ahlUO9FD1cok24HrZHNGkR-ZD6OzXvHedcFtU0RpafAdDdTYcU3GW_kiN_lqNwrbA2uO8LAS-JdQT1E1BFkhengrxFt8Gh_lBm_yE4B6DngvAs-6SGctmNxOc-wfWA3AC_CXKpJviu1P08tz7nYRwAQw_6EH1XaDVl9Cva51cCWUTFzWZ5VHgBUA-GdAyEbLkL9M9rRk0hy-KERwW-2plV_Mu5tpfnFUYZx2ZWwn-_ODEFyindyKiimuwZ6FF5p0pfZxfbMA_EXUdCsUlg1DMlv8zari-50PkhsnkD_DQ-dbmgpiKuM3ZFnL6vCSVw';
Expand Down Expand Up @@ -57,4 +62,9 @@ public function isAccountLinkedV4()
{
return true;
}

public function getAccountsVueCdn()
{
return 'test.com';
}
}

0 comments on commit df85aec

Please sign in to comment.