我目前收到错误:
stripe.handleCardPayment 意图机密的值无效:值应为 ${id}机密${secret} 形式的客户端机密。您指定:pi_1FCNbuIxBpL3Mx4OJYi5hKML。
我首先从 Vue.js 中完成的前端向 Laravel 中完成的后端发出 axios 请求,这会创建一个付款意图(即 pi_1FCNbuIxBpL3Mx4OJYi5hKML)。
StripePackage::setApiKey('sk_test_xxxxxxxxxxx');
$intent = \Stripe\PaymentIntent::create([
'amount' => 1099,
'currency' => 'eur',
]);
return $intent;
Run Code Online (Sandbox Code Playgroud)
我将此付款意图设置为等于名为 data_secret 的全局定义数据变量,该变量是提交付款按钮中的引用:
<button id='test' class='pay-with-stripe' @click='pay' type="button" style="margin-top:20px;" :data-secret="data_secret">Pay with card</button>
Run Code Online (Sandbox Code Playgroud)
单击此按钮时,将调用 pay 方法,该方法又使用 stripe handleCardPaymentMethod:
var cardButton = document.getElementById("test");
var clientSecret = cardButton.dataset.secret;
this.stripe.handleCardPayment(
clientSecret, this.card, {
payment_method_data: {
billing_details: {name: 'Test Name'}
}
}
).
Run Code Online (Sandbox Code Playgroud)
这会触发前面提到的错误。
我一直在关注此文档,但无法看到该问题:https ://stripe.com/docs/ payments/ payment-intents/web
我目前从PHP(Laravel)中完成的应用程序的后端格式返回数据:
data [
{
"Jan": 120,
"Feb": 283.5,
"Mar": 10,
"Apr": 233.92,
"May": 327.78,
"Jun": 190.74,
"Jul": 10,
"Aug": 10,
"Sep": 10,
"Oct": 10,
"Nov": 10,
"Dec": 10
}
]
Run Code Online (Sandbox Code Playgroud)
然后,我想使用JavaScript(Vue)在前端绘制这些数据,这是每月特定公司的平均订单价值.虽然它要工作,但需要采用以下格式:
new_data [
["Jan", 120],
["Feb", 283.5],
["Mar", 10],
["Apr", 233.92],
["May", 327.78],
["Jun", 190.74],
["Jul", 10],
["Aug", 10],
["Sep", 10],
["Oct", 10],
["Nov", 10],
["Dec", 10]
]
Run Code Online (Sandbox Code Playgroud)
我已经看到如何在Stack Overflow(即Object to Array(一个数组数组))上执行类似的操作,但是没有一个适合这个确切的例子.
所有列表项都能正常工作[光标在家里因此颜色会发生变化]虽然左侧有这个额外的"盒子",或者你想要的任何东西.
我不明白为什么这会出现在导航栏的左侧,我希望将其删除,但我不知道该怎么做.
.nav {
background: #2c3e50;
-webkit-columns: 7;
-moz-columns: 7;
columns: 7;
-webkit-column-gap: 0;
-moz-column-gap: 0;
column-gap: 0;
-webkit-column-rule: 1px solid #1a242f;
-moz-column-rule: 1px solid #1a242f;
column-rule: 1px solid #1a242f;
list-style-type: none
}
.nav a {
text-decoration: none;
color: white;
display: block;
padding: 1em;
text-align: center;
border-bottom: 1px solid #1a242f;
}
.nav a:hover {
background: #1a242f;
}
html,
body {
font-family: 'Georgia', serif;
font-weight: 400;
line-height: 1.45;
color: #333;
background: #ecf0f1;
margin: 0px;
}Run Code Online (Sandbox Code Playgroud)
<ul class="nav">
<li><a href="#">Home</a>
</li>
<li><a …Run Code Online (Sandbox Code Playgroud)