Skip to content

Commit eb33a59

Browse files
committed
Added Finance API classes
1 parent ec1ceaa commit eb33a59

File tree

4 files changed

+1319
-0
lines changed

4 files changed

+1319
-0
lines changed

environment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
//Version numbers for cores
3030
$AMAZON_VERSION_FEEDS = '2009-01-01';
31+
$AMAZON_VERSION_FINANCE = '2015-05-01';
3132
$AMAZON_VERSION_INBOUND = '2010-10-01';
3233
$AMAZON_VERSION_INVENTORY = '2010-10-01';
3334
$AMAZON_VERSION_MERCHANT = '2015-06-01';
@@ -100,5 +101,8 @@
100101
//Recommendations
101102
$THROTTLE_LIMIT_RECOMMEND = 8;
102103
$THROTTLE_TIME_RECOMMEND = 2;
104+
//Recommendations
105+
$THROTTLE_LIMIT_FINANCE = 30;
106+
$THROTTLE_TIME_FINANCE = 2;
103107

104108
?>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright 2013 CPI Group, LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
*
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* Core class for Amazon Finances API.
21+
*
22+
* This is the core class for all objects in the Amazon Finance section.
23+
* It contains no methods in itself other than the constructor.
24+
*/
25+
abstract class AmazonFinanceCore extends AmazonCore {
26+
/**
27+
* AmazonFinanceCore constructor sets up key information used in all Amazon Finance Core requests
28+
*
29+
* This constructor is called when initializing all objects in the Amazon Finance Core.
30+
* The parameters are passed by the child objects' constructors, which are
31+
* in turn passed to the AmazonCore constructor. See it for more information
32+
* on these parameters and common methods.
33+
* @param string $s [optional] <p>Name for the store you want to use.
34+
* This parameter is optional if only one store is defined in the config file.</p>
35+
* @param boolean $mock [optional] <p>This is a flag for enabling Mock Mode.
36+
* This defaults to <b>FALSE</b>.</p>
37+
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
38+
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
39+
*/
40+
public function __construct($s = null, $mock = false, $m = null, $config = null){
41+
parent::__construct($s, $mock, $m, $config);
42+
include($this->env);
43+
44+
if(isset($AMAZON_VERSION_FINANCE)){
45+
$this->urlbranch = 'Finances/'.$AMAZON_VERSION_FINANCE;
46+
$this->options['Version'] = $AMAZON_VERSION_FINANCE;
47+
}
48+
49+
if(isset($THROTTLE_LIMIT_FINANCE)) {
50+
$this->throttleLimit = $THROTTLE_LIMIT_FINANCE;
51+
}
52+
if(isset($THROTTLE_TIME_FINANCE)) {
53+
$this->throttleTime = $THROTTLE_TIME_FINANCE;
54+
}
55+
$this->throttleGroup = 'Finance';
56+
}
57+
}

0 commit comments

Comments
 (0)