Stripe 支付网关在实时服务器上抛出异常,在本地服务器上运行良好
Stripe Payment gateway throws an exception on live server working fine on local server
我遇到了有关条带支付网关的问题。我已经使用他们在 Github 提供的库集成了条纹支付
并关注 Stripe Documentation
第一步,我使用密钥设置 API 密钥,然后我创建了客户,最后我向该特定客户收费。
完整代码
\Stripe\Stripe::setApiKey( $stripe_secret_key );
try {
$customer = \Stripe\Customer::create(array(
"source" => $stripeToken,
"email" => $user_email
)
);
$stripe_user_id = $customer->id;
// charge customer by customer ID //
$charge_amount = $stripe_payable_amount * 100;
$charge = \Stripe\Charge::create(array(
'amount' => $charge_amount,
'currency' => $CurrentCurrency,
'customer' => $stripe_user_id
));
} catch ( Exception $e ) {
echo $e->getMessage();
}
以上代码发送异常信息如下所示:
Could not connect to Stripe (https://api.stripe.com/v1/customers/cus_********). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com. (Network error [errno 7]: Failed connect to api.stripe.com:443; Operation now in progress)
我在推特上联系了 strip,他们说你的 DNS 在服务器上配置错误。我咨询了我们的网络管理员。我们这边没有做任何改变。 Stripe API 在同一天工作正常。
相同的代码在 localhost.I 上运行,在本地服务器上使用相同的 测试 API 键 作为我的暂存环境。
请给我任何提示来解决它。
我已经设法解决了上述错误,它与代码无关,因为相同的代码正在本地服务器上运行。我将它部署在另一台它也能正常工作的服务器上。
然后我咨询了我们的 AWS 支持,他们提到他们阻止了我们的端口 443。由于我们服务器上的恶意代码,它被用来向另一个网站发送大量流量。在他们解除对这个端口的封锁后,Stripe 又开始工作了。
我遇到了有关条带支付网关的问题。我已经使用他们在 Github 提供的库集成了条纹支付 并关注 Stripe Documentation
第一步,我使用密钥设置 API 密钥,然后我创建了客户,最后我向该特定客户收费。
完整代码
\Stripe\Stripe::setApiKey( $stripe_secret_key );
try {
$customer = \Stripe\Customer::create(array(
"source" => $stripeToken,
"email" => $user_email
)
);
$stripe_user_id = $customer->id;
// charge customer by customer ID //
$charge_amount = $stripe_payable_amount * 100;
$charge = \Stripe\Charge::create(array(
'amount' => $charge_amount,
'currency' => $CurrentCurrency,
'customer' => $stripe_user_id
));
} catch ( Exception $e ) {
echo $e->getMessage();
}
以上代码发送异常信息如下所示:
Could not connect to Stripe (https://api.stripe.com/v1/customers/cus_********). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com. (Network error [errno 7]: Failed connect to api.stripe.com:443; Operation now in progress)
我在推特上联系了 strip,他们说你的 DNS 在服务器上配置错误。我咨询了我们的网络管理员。我们这边没有做任何改变。 Stripe API 在同一天工作正常。
相同的代码在 localhost.I 上运行,在本地服务器上使用相同的 测试 API 键 作为我的暂存环境。
请给我任何提示来解决它。
我已经设法解决了上述错误,它与代码无关,因为相同的代码正在本地服务器上运行。我将它部署在另一台它也能正常工作的服务器上。
然后我咨询了我们的 AWS 支持,他们提到他们阻止了我们的端口 443。由于我们服务器上的恶意代码,它被用来向另一个网站发送大量流量。在他们解除对这个端口的封锁后,Stripe 又开始工作了。