嗨,我正在将 Instamojo 集成到 wordpress 主题之一中。我使用 Instamojo 类和相关 API 函数来创建 API 请求,执行后它返回响应,但最后附加了 0。我不明白为什么 0 来了。这是我的 instamojo api 代码:
$api = new Instamojo\Instamojo($instamojo_api_key, $instamojo_auth_token);
try {
$response = $api->paymentRequestCreate(array(
'purpose' => 'Test',
'amount' => '20',
'phone' => '8888888888',
'buyer_name' => $username,
'redirect_url' => 'redirect_url',
'send_sms' => false,
"email" => $user_email
));
print($response["longurl"]);///here i am getting long_url but with 0
//// print(rtrim($response["longurl"],0));////tried to remove last 0 not working
}
catch (Exception $e) {
print('Error: ' . $e->getMessage());
}
我是否向 API 调用发送了错误的数据,或者为什么它返回 0 作为响应?