This issue would deal with the initial development of the native_api_amazon within the affiliates_connect_amazon sub-module by incorporating specifically by making API calls through Guzzle. Though initially, the API calls were supposed to be made by involving the REST API and creating REST resources for the same, however, making http calls through cURL for rest involves the need to call the curl_setopt() method to define the header and the particular HTTP verb like GET, POST, PUT, etc. and makes the job pretty complicated. However, Guzzle is far more flexible makes it relatively easier by just initializing the client and providing HTTP verbs and the URL. The authorization layer could be added later on. Also after the skeleton works fine we could add in REST UI integration into the parent module if needed.

As of now, it is done according to the following 2 steps:

  • Setup Amazon Associate account for utilizing the resources of the Product Advertising API
  • Create the basic working skeleton for the amazon native plugin by implementing dummy GET calls by using the Guzzle client to create required methods with HTTP calls to verify that the skeleton is correct and the data is being fetched. Also for the GET aTests could be added later on once the skeleton works as designed.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chiranjeeb2410 created an issue. See original summary.

chiranjeeb2410’s picture

Title: Setup Amazon Associate account and add rest skeleton for amazon native API plugin » Create basic rest skeleton for amazon native API plugin
chiranjeeb2410’s picture

Version: » 8.x-1.x-dev
Issue summary: View changes
chiranjeeb2410’s picture

Status: Active » Needs review
FileSize
15.63 KB

Attached patch containing dummy get call by sending request to PA API endpoint through Guzzle client as mentioned in issue summary above.

Please review and suggest changes.

thedrupalkid’s picture

thedrupalkid’s picture

Assigned: thedrupalkid » Unassigned

Change
affiliates-connectamazon to affiliates-connect-amazon

Why AmazonTestAPIController not AmazonAPIController

Please correct all the naming conventions.

thedrupalkid’s picture

Status: Needs review » Needs work
chiranjeeb2410’s picture

@thedrupalkid,

On it.

chiranjeeb2410’s picture

Assigned: Unassigned » chiranjeeb2410
ankitjain28may’s picture

Title: Create basic rest skeleton for amazon native API plugin » Create amazon native API plugin
Assigned: chiranjeeb2410 » ankitjain28may
Status: Needs work » Needs review
FileSize
73.19 KB

Added the complete Amazon Native API module. Please review.

Limitation-
Pagination is missing and Amazon throttling issue,

Features-
1- User can add the locale and everything will be according to his locale.
2- Search Items from your Locale Categories.
3- Search Items through Product ASIN No.
4- Import Selected Products from the Search Page.
5- Import all the products of the search page through Batch processing (Throttling issue)
6- Everything is configured through the Amazon Settings page.

ankitjain28may’s picture

Ahh, I think, Tests will get failed, I haven't fixed the config form tests of the Amazon Module. Will fix them in next issue.

Status: Needs review » Needs work

The last submitted patch, 10: 2979372-10.patch, failed testing. View results

ankitjain28may’s picture

Status: Needs work » Needs review
ankitjain28may’s picture

Patch rerolled.

Status: Needs review » Needs work

The last submitted patch, 14: 2979372-14.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ankitjain28may’s picture

Status: Needs work » Needs review
ankitjain28may’s picture

Fixed the tests and added routes test for the search page.

Along with that, Implement the pagination feature and request throttling issue is also resolved.

Status: Needs review » Needs work

The last submitted patch, 17: 2979372-17.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ankitjain28may’s picture

Status: Needs work » Needs review
ankitjain28may’s picture

Fixed the tests and made some improvement.

Status: Needs review » Needs work

The last submitted patch, 20: 2979372-20.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ankitjain28may’s picture

Status: Needs work » Needs review

Don't know why tests are failing here, Its passed on my local.

ankitjain28may’s picture

Attach the image for the tests running successfully on my system.

dbjpanda’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.