首页 > 解决方案 > php条带支付API

问题描述

您好,我正在编写一个简单的测试脚本来查看使用 Stripe 付款。我有以下配置文件:

<?php
//require_once('vendor/autoload.php');
//require('stripe-php-master/lib/stripe.php');
$stripeClassesDir = __DIR__ . '/stripe-php-master/lib/';
$stripeUtilDir    = $stripeClassesDir . 'Util/';
$stripeErrorDir   = $stripeClassesDir . 'Error/';
set_include_path($stripeClassesDir . PATH_SEPARATOR . $stripeUtilDir . PATH_SEPARATOR . $stripeErrorDir);
function __autoload($class)
{
    $parts = explode('\\', $class);
    require end($parts) . '.php';
}


$stripe = array(
  "secret_key"      => "123",
  "publishable_key" => "456"
);

\Stripe\Stripe::setApiKey($stripe['secret_key']);
?>

我暂时更换了钥匙。但是,当我使用它时,“用卡付款”按钮似乎可以工作,但我收到错误:require(Request.php): failed to open stream: No such file or directory 我没有使用 Composer。

标签: payment

解决方案


安装 Stripe 时安装的所有库? https://stripe.com/docs/libraries#php

以下是准备使用 API 的方法 https://stripe.com/docs/mobile/ios/standard#prepare-your-api


推荐阅读