【问题标题】:Stripe payment in laravellaravel 中的条纹支付
【发布时间】:2017-09-27 06:34:58
【问题描述】:

我一直在尝试在 laravel 中集成条带支付。

但是当我尝试创建条带客户时,它不会创建。

这是我的代码,

try
{

     $customer = \Stripe\Customer::create(array(
                              'email' => $this->user_email,
                              'card'  => $this->stripe_token
                              )); 

     echo "<pre>";
print_r($customer);exit;
    $charge = \Stripe\Charge::create(array(
                             'customer' => $customer->id,
                             'amount'   => $amountstripe,
                             'currency' => 'EUR'
                             ));

}

我收到一条错误消息,例如,

无法连接到 Stripe (https://api.stripe.com/v1/customers)。请检查您的互联网连接,然后重试。如果此问题仍然存在,您应该通过https://twitter.com/stripestatus 查看 Stripe 的服务状态,或通过 support@stripe.com 告知我们。

(网络错误 [errno 6]:无法解析主机:api.stripe.com)

我该如何解决这个问题?

【问题讨论】:

  • "Could not resolve host: api.stripe.com" 这意味着您的互联网无法与api.stripe.com 建立连接。

标签: laravel curl stripe-payments


【解决方案1】:

这不是 Laravel 或 Stripe 的错误,而是“简单”的网络错误。您的服务器无法向 Stripe 的 API 发送请求,因为它无法将主机名 api.stripe.com 解析为 IP 地址。

您需要联系您的网络管理员或托管服务提供商,并要求他们检查您的服务器与 Stripe 之间的连接。以下脚本可能有助于诊断问题:https://github.com/stripe/stripe-reachability#stripe-reachability

【讨论】:

    猜你喜欢
    • 2020-11-08
    • 2017-09-14
    • 2021-08-02
    • 2020-12-30
    • 2021-01-13
    • 2020-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多