Skip to content

Commit

Permalink
Merge pull request #12 from punchout-catalogs/bugfix/POC-2624-add-sup…
Browse files Browse the repository at this point in the history
…port-for-loginname

Bugfix/poc 2624 add support for loginname
  • Loading branch information
anatolii-lehkyi-poc authored Nov 23, 2021
2 parents f6f287d + ca8c0b2 commit f3099a3
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 16 deletions.
39 changes: 37 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# PunchOutCatalog Changelog
# PunchOutCatalogs Module

[Release Changelog](https://github.com/spryker/punch-out-catalog/releases)
Punchout Catalog Module for Spryker eCommerce Platform

# Changelog

# 2.1.1
- Added the `loginname` OCI field key

# 2.1.0
- Business Unit Fix for POST OCI
- Improved Access Token Error Handling
- Introduced A New Route Provider Plugin


# 2.1.0
- Business Unit Fix for POST OCI
- Improved Access Token Error Handling
- Introduced A New Route Provider Plugin

# 2.0.1
- Adjust dependency

# 2.0.0
- Improve DB structure

# 1.1.2
- Dependency injection fixes

# 1.1.1
- Apply code review fixes

# 1.1.0
- Fixed Setup Request Failure caused by incorrect file name passed to autoloader
- DB update: Renamed 2 indexes in pgw_punchout_catalog_transaction table

# 1.0.0
- Initial Release
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# PunchOutCatalog Module
[![Build Status](https://travis-ci.org/punchout-catalogs/punchout-catalog-spryker.svg)](https://travis-ci.org/punchout-catalogs/punchout-catalog-spryker)
[![Coverage Status](https://coveralls.io/repos/github/punchout-catalogs/punchout-catalog-spryker/badge.svg)](https://coveralls.io/github/punchout-catalogs/punchout-catalog-spryker)
# PunchOutCatalogs Module

Punchout Catalog Module for Spryker eCommerce Platform

Expand All @@ -27,7 +25,7 @@ Running:

### Custom cart mapping

Extending cart mapping behavior could be implemented by overriding
Extending cart mapping behavior could be implemented by overriding
PunchoutCatalog\Yves\PunchoutCatalog\PunchoutCatalogConfig class method:

```php
Expand Down Expand Up @@ -143,12 +141,12 @@ Register Punchout routes in `src/Pyz/Yves/ShopApplication/YvesBootstrap.php`:

```php
<?php

namespace Pyz\Yves\ShopApplication;

use PunchoutCatalog\Yves\PunchoutCatalog\Plugin\Provider\PunchoutCatalogControllerProvider;
use SprykerShop\Yves\ShopApplication\YvesBootstrap as SprykerYvesBootstrap;

class YvesBootstrap extends SprykerYvesBootstrap
{
/**
Expand All @@ -167,7 +165,7 @@ class YvesBootstrap extends SprykerYvesBootstrap

### Handle Auth Token Create Error

The `punchout-catalog.error.auth.token.create` error may happen if the `spy_oauth_access_token.user_identifier` field is too small for data which is storing in the field. By default it is `varchar(1024)`.
The `punchout-catalog.error.auth.token.create` error may happen if the `spy_oauth_access_token.user_identifier` field is too small for data which is storing in the field. By default it is `varchar(1024)`.

The easiest way to improve it is upgrading the field from `varchar(1024)` to `LONGVARCHAR`.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "punchout-catalogs/punchout-catalog-spryker",
"description": "Punchout Catalog Module for Spryker eCommerce Platform",
"version": "2.1.0",
"version": "2.1.1",
"license": "proprietary",
"require": {
"php": ">=7.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ class OciContentProcessor implements OciContentProcessorInterface
public function fetchHeader(array $content): PunchoutCatalogProtocolDataTransfer
{
$username = $hookUrl = null;
$usernameKeys = ['username', 'login', 'cid'];

$usernameKeys = ['username', 'login', 'loginname', 'cid'];
$hookKeys = ['HOOK_URL', 'hook_url', 'Hook_Url'];

foreach ($usernameKeys as $usernameKey) {
if (!empty($content[$usernameKey])) {
$username = $content[$usernameKey];
break;
}
}

foreach ($hookKeys as $hookKey) {
if (!empty($content[$hookKey])) {
$hookUrl = $content[$hookKey];
break;
}
}

$password = $content['password'] ?? null;

return (new PunchoutCatalogProtocolDataTransfer())
Expand Down

0 comments on commit f3099a3

Please sign in to comment.