zera555/share-a-sale-api-client

Share-A-Sale API 的 PHP 客户端

v1.2 2020-01-28 19:15 UTC

This package is not auto-updated.

Last update: 2024-10-03 16:16:50 UTC


README

Build Status License

简介

用于消耗 Share-A-Sale API 的 Zend Framework 模块

安装

使用 Composer 在您的应用程序的 vendor 目录中安装模块。将以下行添加到您的 composer.json 文件中。

{
    "require": {
        "zera555/share-a-sale-api-client": "1.*"
    }
}

配置

在您的 application.config.php 文件中启用该模块。

return array(
    'modules' => array(
        'Zera555\ShareASale'
    )
);

shareasale.local.php.dist 文件复制并粘贴到您的 config/autoload 文件夹中,并使用您的凭据和其他配置设置进行自定义。确保从您的文件中删除 .dist。您的 shareasale.local.php 可能看起来像以下内容

<?php
return [
    'shareasale_service' => [
        'service_url' => 'https://shareasale.com',
        'service_version' => '2.1',
        'affiliate_id' => '<affiliate-id>',
        'token' => '<token>',
        'secret_key' => '<secret-key>',
    ]
];

用法

从您的代码中调用

        use Zera555\ShareASale\Service\ShareASaleService;
        
        $service = new ShareASaleService();
        
        $options = [
            'dateStart' => '6/22/2016',
        ];
        
        $records = $service->activity($options);
        
        var_dump($records);
        

使用控制台

php public/index.php shareasale activity -v

实现的服务方法

  • activity
  • activitySummary
  • merchantTimespan
  • dailyActivity
  • monthlySummary
  • voidtrail
  • traffic
  • apitokencount
  • getProducts
  • invalidLinks
  • orderInquiry
  • merchantDataFeeds
  • couponDeals
  • merchantStatus
  • merchantCreative
  • merchantGiftCard
  • edittrail
  • paymentSummary
  • merchantSearch
  • merchantSearchProduct
  • ledger
  • balance

链接