setCartId() public method

Sets the cart id
public setCartId ( string $cartId )
$cartId string
Exemplo n.º 1
0
 public function testGetCartId()
 {
     $cart = new CartAdd();
     $this->assertEquals(null, $cart->getCartId());
     $cart->setCartId('789');
     $this->assertEquals('789', $cart->getCartId());
 }
Exemplo n.º 2
0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'bootstrap.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Config.php';
use ApaiIO\ApaiIO;
use ApaiIO\Configuration\GenericConfiguration;
use ApaiIO\Operations\CartAdd;
use ApaiIO\Operations\CartCreate;
$conf = new GenericConfiguration();
try {
    $conf->setCountry('de')->setAccessKey(AWS_API_KEY)->setSecretKey(AWS_API_SECRET_KEY)->setAssociateTag(AWS_ASSOCIATE_TAG);
} catch (\Exception $e) {
    echo $e->getMessage();
}
$apaiIO = new ApaiIO($conf);
$cartCreate = new CartCreate();
$cartCreate->addItem("B0040PBK32", 1);
$formattedResponse = $apaiIO->runOperation($cartCreate);
echo $formattedResponse;
echo "<hr>";
$cartAdd = new CartAdd();
$cartAdd->setCartId('280-6695255-7497359');
$cartAdd->setHMAC('LxQ0BKVBeQTrzFCXvIoa/262EcU=');
$cartAdd->addItem('B003YL444A', 1);
$formattedResponse = $apaiIO->runOperation($cartAdd);
echo $formattedResponse;
Exemplo n.º 3
0
 public function testSetter()
 {
     $cart = new CartAdd();
     $cart->setHMAC('1234');
     $cart->setCartId('789');
 }