条纹支付网关在本地服务器上正常工作的实时服务器上引发异常 [英] Stripe Payment gateway throws an exception on live server working fine on local server

查看:57
本文介绍了条纹支付网关在本地服务器上正常工作的实时服务器上引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在条带支付网关方面遇到了问题.我使用他们在

相同的代码在 localhost 上运行.我在本地服务器上使用相同的 Test API 密钥 作为我的登台环境.

请给我任何提示来解决它.

解决方案

我已经设法解决了上述错误,它与代码无关,因为相同的代码正在本地服务器上运行.我将它部署在另一台服务器上,它也能正常工作.

然后我检查了我们的 AWS 支持,他们提到他们阻止了我们的端口 443.由于我们服务器上的恶意代码,它被用来将大量流量发送到另一个网站.在他们解除对这个端口的封锁后,Stripe 又开始工作了.

I am facing an issue on stripe payment gateways. I have integrated stripe payment using their library given at Github and following Stripe Documentation

On first step i setup API key using secret key, then i created customer finally i charged that particular customer.

Full Code

\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();

    }

Above code sent an exception message as shown below:

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)

I contacted strip on twitter they said your DNS is miss configured on sever. I checked with our network admin. There is no change made from our side. Stripe API was working fine on same day.

Same code is working on localhost.I used same Test API keys on local server as my staging environment.

Please give me any hint to troubleshoot it.

解决方案

I have managed to solve the above error, it has nothing to do with code as same code is working on local server. I deployed it on an another server it worked as well.

Then i checked with our AWS support they mentioned they blocked our port 443. It was being used to send lot of traffic to another website due to malicious code on our server. After they unblock this port Stripe started working again.

这篇关于条纹支付网关在本地服务器上正常工作的实时服务器上引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆