标签: stripe-payments

Stripe API:列出所有费用

我使用https://stripe.com/docs/api?lang=php#list_charges获取列出所有费用但在此处指定

count可选 - 默认值是对要返回的对象数的限制.计数可以介于1到100个项目之间.

我有成千上万的条目,现在我怎么能得到所有.虽然如果我将count设置为100,它会返回110条记录.

php stripe-payments

0
推荐指数
1
解决办法
7332
查看次数

使用 Stripe 充电时“没有这样的客户”

我正在使用 Stripe API 进行测试,但无法让这个基本的“市场”场景发挥作用。该场景是买家从卖家处购买,应用程序需要付费。

我的设置:

# Seller has already connected their account to the application 
# through "Stripe Connect Standalone". Below will attempt to charge a customer.

import stripe

# application's sk from stripe
stripe.api_key = "sk...."

# Build customer
customer = stripe.Customer.create(
    email = customer.email,
    card = token_from_stripe_checkout
)

# Now do a charge
charge = stripe.Charge.create(
    amount = 2000,
    currency = "usd",
    customer = customer.id,
    application_fee = 500,
    stripe_account = seller.stripe_user_id # which is something like: acct_xxxxxxxxx
) …
Run Code Online (Sandbox Code Playgroud)

python stripe-payments stripe.net stripe-connect

0
推荐指数
1
解决办法
4558
查看次数

使用Cashier 7.0获取Laravel 5.3中的Stripe客户详细信息

在Laravel 5.1with Cashier中~5.0,我曾经像这样获得该用户的Stipe客户详细信息:

$customer = $user->subscription()->getStripeCustomer();

5.3使用Cashier 更新到Laravel之后~7.0,我将控制器中的上述行更改为:

$customer = $user->subscription('main')->getStripeCustomer();

自更新以来,我现在收到错误:

BadMethodCallException in Builder.php line 2440: 
Call to undefined method Illuminate\Database\Query\Builder::getStripeCustomer()
Run Code Online (Sandbox Code Playgroud)

我怎样才能得到条纹的客户详细信息Laravel 5.3Cashier ~7.0

laravel stripe-payments laravel-5 laravel-cashier laravel-5.3

0
推荐指数
1
解决办法
640
查看次数

Stripe – “无效的时间戳:未来不能超过五年”

我正在使用 Node.js Stripe 包,我想向客户添加一个新订阅,该订阅将在 30 秒后到期。这是我的代码:

var toCreate = {
  customer: 'customer_id',
  items: [{
    plan: 'plan_id'
  }],
  coupon: 'coupon_code',
}
stripe.customers.create({xyz: 'This will give an error with the server time in the header'}).then(success => {},
  error => {
    var seconds = 30;
    toCreate.trial_end = new Date(error.raw.headers.date).getTime() + (seconds * 1000);
    console.log('End time', toCreate.trial_end);
    return stripe.subscriptions.create(toCreate).then(successful => {
      console.log(successful)
    }, error => {
      console.log(error)
    })
  })
Run Code Online (Sandbox Code Playgroud)

该代码故意创建错误以获取准确的服务器时间,然后进行实际stripe.subscriptions.create调用。

当我打电话时stripe.subscriptions.create,Stripe 给了我这个错误:

时间戳无效:不能超过未来五年

在这种情况下,我的代码给它的时间戳是1535104976000. 它包含在错误消息标题中:

date: 'Fri, 24 …
Run Code Online (Sandbox Code Playgroud)

datetime node.js stripe-payments

0
推荐指数
1
解决办法
1168
查看次数

如何使Stripe手动将事件重新发送到Webhook

我一直在使用Stripe API,并且已经成功调用我的Webhook大约一年了。

但是昨天第一次出现了问题。Webhook未能成功完成其预期的操作,但是无论如何返回了200状态代码,因此Stripe不再重试。

我现在已经解决了Webhook上的错误,但无法弄清楚如何使Stripe对该特定事件重复webhook调用。我可以检索该事件,但是没有要重新发送的按钮。如何?

api stripe-payments

0
推荐指数
3
解决办法
1201
查看次数

0
推荐指数
1
解决办法
1445
查看次数

Nuxt 中没有定义 Stripe

我想将条纹元素添加到我的 nuxt js 页面但是,出现错误

条纹未定义

我已经插入了 <script src="https://js.stripe.com/v3/"></script>我的nuxt.config.js

这是代码

 head: {
    title: process.env.npm_package_name || "",
    script: [{ src: "https://js.stripe.com/v3/" }],
    link: [
      { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
    ]
  },
Run Code Online (Sandbox Code Playgroud)

我的付款页面

<template>
  <div>
    <div ref="card"></div>
    <button v-on:click="purchase">Purchase</button>
  </div>
</template>

<script>
let stripe = Stripe("Key"),
  elements = stripe.elements(),
  card = undefined;
export default {
  mounted: function() {
    card = elements.create("card");
    card.mount(this.$refs.card);
  },
  methods: {
    async purchase() {
      let result = await stripe.createToken(card);
    }
  }
};
</script>
Run Code Online (Sandbox Code Playgroud)

我遵循了本教程,但仍然无法修复它 …

stripe-payments vue.js nuxt.js

0
推荐指数
1
解决办法
2172
查看次数

实时模式中存在类似的对象,但使用测试模式密钥来发出此请求。扔进php

我正在尝试以条带实时模式付款,但显示以下错误:

PHP Fatal error: Uncaught (Status 400) (Request req_uocWWxAIPTJ6ZR) No such token: tok_1FbZniE3n36TXaJ5sMm5KSsX; 实时模式中存在类似的对象,但使用测试模式密钥来发出此请求。
扔进去

我已经在网上阅读了几个教程,但仍然没有正面。

 require_once "vendor/autoload.php";

\Stripe\Stripe::setApiKey('sk_live_xxxxxxxxxxxxxxxxxxxxxx');
 $token = $_POST['stripeToken'];


    // Add customer to stripe 
  $customer = \Stripe\Customer::create(array( 
        'email' => $email, 
        'source'  => $token 
    )); 

  // Unique order ID 
    $orderID = strtoupper(str_replace('.','',uniqid('', true))); 

    // Charge a credit or a debit card 
    $charge = \Stripe\Charge::create(array( 
        'customer' => $customer->id, 
        'amount'   => $amt, 
        "currency" => "usd",
        'description' => "Payment for ". $rooms, 
        'metadata' => array( 
            'order_id' => $orderID 
        ) 
    )); 

    // …
Run Code Online (Sandbox Code Playgroud)

php stripe-payments

0
推荐指数
1
解决办法
2619
查看次数

如何修复 Stripe 付款错误?未找到与有效负载的预期签名匹配的签名

为什么我会发现这个错误?

我在这里看到过类似的问题,但它们似乎没有解决我的问题。

错误:未找到与负载的预期签名匹配的签名。您是否正在传递从 Stripe 收到的原始请求正文?https://github.com/stripe/stripe-node#webhook-signing

这是我的 index.ts 删除了键。

import * as functions from 'firebase-functions';

import * as Stripe from 'stripe';
const stripe = new Stripe('sk_test_*****************************');
const endpointSecret = 'whsec_******************************';

import * as express from 'express';
import * as cors from 'cors';


const bodyParser = require('body-parser')

const app = express();
app.use(cors({origin: true}));


app.post('/webhook', bodyParser.raw({type: 'application/json'}), async(req, res) => {

  const sig = req.headers['stripe-signature'] as string;
  let event;

    try {
      event = stripe.webhooks.constructEvent(req.body, sig, endpointSecret);
    } catch (err) {

      console.log("ERROR!!!1");
      console.log(err); …
Run Code Online (Sandbox Code Playgroud)

stripe-payments firebase typescript

0
推荐指数
2
解决办法
3160
查看次数

使用 API ID 通过 Stripe 一次性付款

我使用 Stripe 创建了一个订阅服务。我可以订阅用户使用定期付款。这是相关代码(节点):

  // Create the subscription
  const subscription = await stripe.subscriptions.create({
    customer: req.body.customerId,
    items: [{ price: req.body.priceId }],
    expand: ['latest_invoice.payment_intent'],
  });
Run Code Online (Sandbox Code Playgroud)

这有效并使用priceId仪表板中所示的:

在此处输入图片说明

但是,当我销售不经常出现的产品时,它就会失败。我收到错误:

The price specified is set to `type=one_time` but this field only accepts prices with `type=recurring`
Run Code Online (Sandbox Code Playgroud)

我理解错误,但我不确定是否可以将订阅设置为不重复。

我的应用程序有 3 层:

  • 一旦脱落
  • 每月
  • 每年

理想情况下,我不想添加一个全新的代码段来处理似乎是订阅所做的一个子集的事情,但即使我这样做了,该paymentIntent对象似乎只需要一个数量而不是 API ID,如图所示. 有没有办法使用我已经建立的基础设施来做到这一点?

stripe-payments

0
推荐指数
1
解决办法
1221
查看次数