firelike/share-a-sale-api-client

Share-A-Sale API 的 PHP 客户端

v1.1.2 2016-12-22 18:49 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:15:21 UTC


README

Build Status License

简介

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

安装

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

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

配置

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

return array(
    'modules' => array(
        'Firelike\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 Firelike\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

链接