$ch = curl_init("https://test.chargify.com/subscriptions/10441751.json");
$data = array(
'subscription' => array(
'customer' => array(
'address' => "test123"
)
)
);
$data = json_encode($data);
curl_setopt_array($ch, array(
CURLOPT_USERPWD => "xxx:x", // assume this is correct
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data)
)
));
$output = curl_exec($ch);
curl_close($ch);我在尝试更新chargify订阅时卡住了。cURL调用的输出是完全相同的。客户地址不变。有什么想法可能是错误的吗?
发布于 2015-10-14 02:15:51
您似乎无法从subscriptions.json更新客户信息。我必须从订阅中提取客户ID,然后通过https://test.chargify.com/customers/XXX.json更新客户信息
https://stackoverflow.com/questions/33105373
复制相似问题