【问题标题】:'Could not determine which URL to request: Stripe_Charge instance has invalid ID'无法确定请求哪个 URL:Stripe_Charge 实例的 ID 无效
【发布时间】:2013-03-22 18:13:39
【问题描述】:

我想在网站中实施 Strip 支付流程。我试图这样做,但它看起来不起作用。我得到的错误是

致命错误:在 /home/twassist/public_html/wp-content/themes/inovado/stripe-php-1.7 中出现消息“无法确定要请求的 URL:Stripe_Charge 实例具有无效 ID:”的未捕获异常“Stripe_InvalidRequestError” .15/lib/Stripe/ApiResource.php:46 堆栈跟踪:#0 /home/twassist/public_html/wp-content/themes/inovado/stripe-php-1.7.15/lib/Stripe/ApiResource.php(15) : Stripe_ApiResource->instanceUrl() #1 /home/twassist/public_html/wp-content/themes/inovado/stripe-php-1.7.15/lib/Stripe/ApiResource.php(8): Stripe_ApiResource->refresh() # 2 /home/twassist/public_html/wp-content/themes/inovado/stripe-php-1.7.15/lib/Stripe/Charge.php(14): Stripe_ApiResource::_scopedRetrieve('Stripe_Charge', NULL, NULL) #3 /home/twassist/public_html/wp-content/themes/inovado/functions.php(355): Stripe_Charge::retrieve(NULL) #4 /home/twassist/public_html/wp-content/themes/inovado/functions.php( 361): Strip_Code() #5 /home/twassist/public_html/wp-settings.php(291): include('/home/twassist/...') #6 / home/twassist/public_html/wp-config.php(在 /home/twassist/public_html/wp-content/themes/inovado/stripe-php-1.7.15/lib/Stripe/ApiResource.php 第 46 行

这里有人试过吗http://twassistant.com/hire更改数量。

填写此详细信息 5555 5555 5555 4444 到期日期 12 / 21 名称:任何 121。

这将进行测试付款。当重定向到代码时,它会给你这个错误。

这是我在我的 php 文件中尝试的代码。

function Strip_Code()
{
    $stripCode = trim($_GET['stripeToken']);

    if (strlen($stripCode) > 0) {

        require_once  dirname(__FILE__).'/stripe-php-1.7.15/lib/Stripe.php';

        Stripe::setApiKey("sk_test_XXXXXXXXXXXXXXX");

        $resp = Stripe_Charge::retrieve($$stripCode);

        var_dump($resp);
    }
}

Strip_Code();

【问题讨论】:

    标签: php stripe-payments


    【解决方案1】:

    可能是你有一个错字(双 $$):

    Stripe_Charge::retrieve($$stripCode);
    

    另外,你不应该透露你的私钥......即使它只是你的测试密钥

    【讨论】:

      猜你喜欢
      • 2021-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      • 2020-09-24
      • 1970-01-01
      相关资源
      最近更新 更多