Php 尝试在TradeGecko API中添加新订单时出错500
非常具体的问题,但我会尽我最大的努力解决 我可以很容易地向TradegeckoAPI(详细信息如下:)发出POST请求,并获得不同的价格作为回报,这部分交互工作非常顺利 然而,我正在尝试创建一个新的订单,我觉得我错过了一些东西 以下是我所拥有的:Php 尝试在TradeGecko API中添加新订单时出错500,php,post,oauth-2.0,Php,Post,Oauth 2.0,非常具体的问题,但我会尽我最大的努力解决 我可以很容易地向TradegeckoAPI(详细信息如下:)发出POST请求,并获得不同的价格作为回报,这部分交互工作非常顺利 然而,我正在尝试创建一个新的订单,我觉得我错过了一些东西 以下是我所拥有的: <?php $authorizeUrl = 'https://api.tradegecko.com/oauth/authorize'; $accessTokenUrl = 'https://api.tradegecko.com/oauth/tok
<?php
$authorizeUrl = 'https://api.tradegecko.com/oauth/authorize';
$accessTokenUrl = 'https://api.tradegecko.com/oauth/token';
$clientId = <MY_CLIENT_ID>;
$clientSecret = <MY_CLIENT_SECRET>;
$redirectUrl = <REDIRECT_URI>;
// https://github.com/adoy/PHP-OAuth2
require("Client.php");
require("GrantType/IGrantType.php");
require("GrantType/AuthorizationCode.php");
$client = new OAuth2\Client($clientId, $clientSecret, OAuth2\Client::AUTH_TYPE_AUTHORIZATION_BASIC);
$client->setCurlOption(CURLOPT_USERAGENT,$userAgent);
$client->setAccessToken(<MY_ACCESS_TOKEN>);
$client->setAccessTokenType(OAuth2\Client::ACCESS_TOKEN_BEARER);
$params =
array('order' =>
array(
'company_id' => '12345',
'shipping_address_id' => 1,
'billing_address_id' => 1,
'status' => 'active',
'issued_at' => '10-04-2016',
'order_line_items' => array(
array('variant_id' => 123456,
'quantity' => 2),
array('variant_id' => 123457,
'quantity' => 2)
)
)
);
$response = $client->fetch('https://api.tradegecko.com/orders', false, $params);
print_r($response);
?>
我希望这段代码中有其他人可能会发现的东西,我已经盯着它看了6个小时了,但我不明白为什么不能通过。你知道吗?