LaravelPackages.net
Acme Inc.
Toggle sidebar
gptinker/laravel-google-merchant

A sample Laravel package to manage products on Google merchant center

8
0
1.4
About gptinker/laravel-google-merchant

gptinker/laravel-google-merchant is a Laravel package for a sample laravel package to manage products on google merchant center. It currently has 0 GitHub stars and 8 downloads on Packagist (latest version 1.4). Install it with composer require gptinker/laravel-google-merchant. Discover more Laravel packages by gptinker or browse all Laravel packages to compare alternatives.

Last updated

Google Merchant Center APIs for Laravel

Installation

composer require gptinker/google-merchant

Setup

1. Add Variable given below to .env file
GOOGLE_MERCHANT_ID="1234567890"
GOOGLE_MERCHANT_TARGET_COUNTRY="AE"
GOOGLE_MERCHANT_CONTENT_LANGUAGE="en"
GOOGLE_MERCHANT_CHANNEL="online"
2. Store your credentials JSON file in storage/json folder named google-merchant-credentials.json
storage/json/google-merchant-credentials.json

Usage

use Gptinker\GoogleMerchant\Facades\ProductApi;

1. Fetch Products

$response = ProductApi::fetch();

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}

2. Insert Product

The request body contains an instance of Product

$response = ProductApi::insert($product);

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}

3. Get Product

$product_id = Same id used in "offerId" while insertion
$response = ProductApi::get($product_id);

if($response['status'] == 'success'){
    // Found
}else{
    // Not Found
}

4. Update Product

The request body contains an instance of Product

$product_id = Same id used in "offerId" while insertion
$response = ProductApi::update($product, $product_id);

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}

5. Delete Product

$product_id = Same id used in "offerId" while insertion
$response = ProductApi::delete($product_id);

if($response['status'] == 'success'){
    // Success
}else{
    // Error
}
Comments