gptinker/laravel-google-merchant
最新稳定版本:1.4
Composer 安装命令:
composer require gptinker/laravel-google-merchant
包简介
A sample Laravel package to manage products on Google merchant center
README 文档
README
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 }
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-10