我在本地开发环境中使用WAMP,我正在尝试从信用卡收费,但收到错误消息:
cURL错误60:SSL证书问题:无法获取本地颁发者证书
我在Google上搜索了很多,很多人都建议我下载这个文件:cacert.pem,把它放在某处并在我的php.ini中引用它.这是我的php.ini中的一部分:
curl.cainfo = "C:\Windows\cacert.pem"
Run Code Online (Sandbox Code Playgroud)
然而,即使多次重启我的服务器并更改路径,我也会收到相同的错误消息.
我使用Apache模块中的WAMP并启用了ssl_module.从PGP扩展我启用了php_curl.
仍然是相同的错误消息.为什么会这样?
现在我正在关注此修复程序:如何修复PHP CURL错误60 SSL
这表明我将这些行添加到我的cURL选项中:
curl_setopt($process, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
curl_setopt($process, CURLOPT_SSL_VERIFYPEER, true);
Run Code Online (Sandbox Code Playgroud)
我在哪里添加选项到我的cURL?显然不是通过命令行,因为我的CLI没有找到命令"curl_setopt"
编辑
这是我正在运行的代码:
public function chargeStripe()
{
$stripe = new Stripe;
$stripe = Stripe::make(env('STRIPE_PUBLIC_KEY'));
$charge = $stripe->charges()->create([
'amount' => 2900,
'customer' => Input::get('stripeEmail'),
'currency' => 'EUR',
]);
dd($charge);
// echo $charge[Input::get('stripeToken')];
return Redirect::route('step1');
}
Run Code Online (Sandbox Code Playgroud) 我们开始在Redsmin(我们的项目之一)上实现Stripe ,我想我们可能错过了一些东西.下面是它的工作原理:
要使用我们的产品,用户必须选择一个计划(免费,s,m,xl,xxl ...),然后输入其登录名/密码,然后可以免费试用30天.当用户提交表单时,我们的服务器使用指定的计划调用Stripe create_customer而不使用信用卡(因为我们希望免费提供30天而不需要信用卡)并且我们使用返回的customer_id和更新我们这边的用户模型subscription_id.
我们设置了一个webhook接收条带事件,所以30天后我们的webhook 应该收到一个customer.subscription.updated带有的事件object.status == active.我对吗?
但是,由于我们没有在注册时为用户指定相关卡,我们应该在另一个customer.subscription.updated事件之后快速收到,object.status == unpaid对吗?然后在我们这边,我们停用用户帐户并强制它转到我们的计划选择页面.
从那时起,用户可以选择免费计划或我们的高级计划之一:
#Scenario 1如果用户选择免费计划,我们只需重新激活其帐户,不做任何其他事情,因为我们将条带上的免费计划配置为成本0 $.我们是否通过免费计划实施了正确的流程?还有更好的方法吗?
#Scenario 2如果用户选择了高级计划,我们会将他重定向到信用卡表单,然后将其发送到Stripe,我们会使用临时卡令牌更新条带客户帐户.接下来我们该怎么办?:
customer.subscription.updated?charge.succeeded?那么它的价值是object.status什么?credit-card saas payment-gateway payment-processing stripe-payments
自 2022 年 6 月 2 日以来,我们的哨兵日志中一直面临代码中的引用错误。而且它只发生在 iOS (iphone) 设备上。
请找到下面的链接查看错误: https://sentry.io/share/issue/876e86524c96471b9524f70afb16faf7/
我们正在使用stripe并react-js创建我们的应用程序,但在我们的应用程序或条带代码中找不到任何此类方法。
我们不知道它可能是什么,加上搜索getValuesOfAutofillInputs或PaymentAutofillConfig在谷歌上也给出零结果..
根据我们的理解,这似乎是 Facebook 网页视图上的问题(当我们在 Instagram 或 Facebook 应用程序中打开链接时)
期待听到是否有人遇到此问题或让我们知道在哪里报告或为此创建问题?
背景
我正在尝试将条带付款整合到我的网站中.我需要使用私有条带密钥创建条带用户.我将此密钥存储在我的服务器上,并调用服务器方法来创建用户.也许有另一种方法可以实现这一目标?这是条纹api(为方便起见,下面复制):https: //stripe.com/docs/api/node#create_customer
//stripe api call
var Stripe = StripeAPI('my_secret_key');
Stripe.customers.create({
description: 'Customer for test@example.com',
card: "foobar" // obtained with Stripe.js
}, function(err, customer) {
// asynchronously called
});
Run Code Online (Sandbox Code Playgroud)
我的尝试和结果
我一直在使用不同服务器代码的相同客户端代码.所有尝试都会在客户端的console.log(...)上立即给出undefined,但在服务器console.log(...)上给出正确的响应:
//client
Meteor.call('stripeCreateUser', options, function(err, result) {
console.log(err, result);
});
//server attempt 1
var Stripe = StripeAPI('my_secret_key');
Meteor.methods({
stripeCreateUser: function(options) {
return Meteor.wrapAsync(Stripe.customers.create({
description: 'Woot! A new customer!',
card: options.ccToken,
plan: options.pricingPlan
}, function (err, res) {
console.log(res, err);
return (res || err);
}));
}
});
//server attempt …Run Code Online (Sandbox Code Playgroud) 更新:从2018年1月左右开始,现在可以使用emailStripe上的参数进行搜索 .看到接受的答案.
我想知道在使用Stripe API时是否可以仅通过他们的电子邮件地址搜索客户.
该文档仅表示通过搜索:
created,
ending_before,
limit,
starting_after
Run Code Online (Sandbox Code Playgroud)
但不是email.
我想避免列出我的所有客户,以找到哪些客户具有相同的电子邮件地址.
在网站上测试STRIPE期间,我构建了这样的代码:
try {
$charge = Stripe_Charge::create(array(
"amount" => $clientPriceStripe, // amount in cents
"currency" => "usd",
"customer" => $customer->id,
"description" => $description));
$success = 1;
$paymentProcessor="Credit card (www.stripe.com)";
}
catch (Stripe_InvalidRequestError $a) {
// Since it's a decline, Stripe_CardError will be caught
$error3 = $a->getMessage();
}
catch (Stripe_Error $e) {
// Since it's a decline, Stripe_CardError will be caught
$error2 = $e->getMessage();
$error = 1;
}
if ($success!=1)
{
$_SESSION['error3'] = $error3;
$_SESSION['error2'] = $error2;
header('Location: checkout.php');
exit();
}
Run Code Online (Sandbox Code Playgroud)
问题是卡有时会出错(没有被我在那里的"catch"参数捕获)并且"try"失败并且页面立即在屏幕上发布错误而不是进入"if"和重定向回checkout.php. …
我正在使用Stripe API设置付款,以允许用户在iPad上登录其Stripe帐户并接受任何人的付款.为此,我使用Stripe Connect登录并保存他们的帐户ID,然后我用它STPPaymentCardTextField来获取信用卡详细信息,然后使用Stripe iOS SDK我提交了一张卡(带有测试卡信息) - 4242 ...)并通过获取令牌createTokenWithCard.这成功返回一个令牌.此时我需要将该令牌连同目标帐户ID(在用户登录后提供给应用程序)和其他信息(货币,金额等)提交到我自己的服务器以将付款提交给Stripe.我已经确认信息正在提交并转发到Stripe,但Stripe返回错误:
{ type: 'invalid_request_error',
app[web.1]: message: 'No such token: tok_13vxes2eZkKYli2C9bHY1YfX',
app[web.1]: param: 'source',
app[web.1]: statusCode: 400,
app[web.1]: requestId: 'req_7AIT8cEasnzEaq' },
app[web.1]: requestId: 'req_7AIT8cEasnzEaq',
app[web.1]: statusCode: 400 }
Run Code Online (Sandbox Code Playgroud)
如果我们直接提交信用卡信息,完全避免令牌,则付款成功.这个令牌有问题,我们不确定它为什么会失败.这可能会出错?
[[STPAPIClient sharedClient] createTokenWithCard:card completion:^(STPToken *token, NSError *error) {
//submit tokenId and other info to 'charge' endpoint below
}
Run Code Online (Sandbox Code Playgroud)
的NodeJS:
app.post('/charge', (req, res, next) => {
stripe.charges.create({
amount: req.body.amount,
currency: req.body.currency,
source: req.body.token,
description: req.body.description,
destination: req.body.destination
}, (err, charge) => { …Run Code Online (Sandbox Code Playgroud) 在测试模式下,当我创建新客户并尝试付款时,我收到此错误.
客户cus_7Zz2BCnybIZLGw没有ID为tok_17Kp8GAwLkQPB7OqrrM73VVI的链接卡
我使用卡号:4242424242424242 exp_month:12 exp_year 2016
回复是,
Array
(
[charge_status] =>
[error_info] => Array
(
[type] => invalid_request_error
[message] => Customer cus_7Zz2BCnybIZLGw does not have a linked card with ID tok_17Kp8GAwLkQPB7OqrrM73VVI.
[param] => card
[code] => missing
)
[message] => Customer cus_7Zz2BCnybIZLGw does not have a linked card with ID tok_17Kp8GAwLkQPB7OqrrM73VVI.
)
Run Code Online (Sandbox Code Playgroud)
输入费用数据是,
$customer = Stripe_Customer::create(array(
'account_balance' => 100,
'source' => $token,
'email' => strip_tags(trim($email))
)
);
$customer_id = $customer->id;
$charge = array(
'card' => 4242424242424242,
'amount' => 100,
'currency' …Run Code Online (Sandbox Code Playgroud) 在 Stripe 中,我的客户想要电子邮件和持卡人姓名,但Stripe支付 UI 没有在com.stripe.android.view.CardMultilineWidget 中提供该选项。我想试试最新的条纹版本,
我使用的是条纹版本(14.1.1)。所以更新到最新的(16.8.0)
Build 向我展示了它不需要 minSdkVersion 19. requires 21 in manifest merge 的错误。所以我将 minSdkVersion 更新为 21
我得到了 caches/transforms-2/files-2.1/4541b0189187e0017d23bbb0afebd16a/jetified-kotlin-stdlib-common-1.5.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module 的模块不兼容的编译版本 Kotlin_module: . 其元数据的二进制版本为 1.5.1,预期版本为 1.1.15。
我厌倦了改变 gradle 版本。仍然得到同样的错误。需要一些帮助来解决不兼容的错误并在条带中添加电子邮件和持卡人姓名。谢谢。
是否可以在期末而不是立即降级用户?我已经梳理了API Docs,但却无法弄清楚如何实现这一目标.
作为一种解决方法,我目前正在取消用户的订阅,然后订阅较少的订阅,试用到月底.这不会起作用 - 我需要能够将降级延迟到期末(但是在请求降级时"记录"它与Stripe).
很明显,有一些方法可以通过webhook回调和本地跟踪用户订阅来实现这一目标,但我希望尽可能避免这种情况.
编辑
在有人要求之前 - 我正在使用Temboo的PHP SDK.但是,我不是在寻找一种特定于语言的方法,只是一种高级的方法(如果可能的话).