BigCommerce PHP API无法连接

时间:2013-11-12 02:20:21

标签: php api bigcommerce

我需要在与Bigcommerce的PHP代码连接中有一个见解,在此代码中它有一个输出“startupmiddlemiddle1”但它无法输出产品..我们的帮助非常感谢..谢谢!

<?php
echo "start";

require 'bigcommerce-api-php-master/bigcommerce.php';
use Bigcommerce\Api\Client as Bigcommerce;

echo "up";

Bigcommerce::configure(array(
    'store_url' => 'https://store-h9a8oj.mybigcommerce.com/',
    'username' => 'admin',
    'api_key' => 'xxxxxxxxxxxxxxxxxxxxxxx'
    ));

echo "middle";
Bigcommerce::setCipher('RC4-SHA');
Bigcommerce::verifyPeer(false);
echo "middle1";

$products = Bigcommerce::getProducts();
foreach($products as $product) {
echo $product->name;
echo $product->price;
        }
echo "end";
?>

2 个答案:

答案 0 :(得分:0)

一切都设置正确。确保满足所有要求(启用了php 5.3 +,cUrl扩展)并再次尝试。另外,请确保将github中的所有文件复制到bigcommerce-api-php-master /目录中,而不仅仅是“bigcommerce.php”文件。

答案 1 :(得分:0)

更改密码,您可以使用 rsa_rc4_128_sha 代替 RC4-SHA

     // Bigcommerce::setCipher('RC4-SHA');
    Bigcommerce::setCipher('rsa_rc4_128_sha');

希望它能奏效:)

谢谢和问候,
Alpa W