标签: stripe-payments

是否可以使用Stripe API查询日期时间范围?

使用Stripe API,我希望能够查询日期范围,或者,如果失败,那么日期大于小于某个任意日期.

我知道我可以根据确切的日期查询某些内容,例如:

https://api.stripe.com/v1/events?created=1336503409
Run Code Online (Sandbox Code Playgroud)

但我想要的东西......

# Search for events where `created` is greater than the epoch time: 1336503400
https://api.stripe.com/v1/events?created__gt=1336503400 
Run Code Online (Sandbox Code Playgroud)

api json http stripe-payments

9
推荐指数
3
解决办法
4962
查看次数

在条带按钮上设置数据属性

我无法弄清楚这一点.我检查了有关设置数据属性的其他问题,似乎是一件非常棘手的事情.

条纹按钮数量纯粹是为了美观,我每次用户更新数量选择框时都试图设置它('数据量').

每次我更改数量时选择一个警报给出正确的数量,如果我检查dom,'data-amount'属性似乎设置正确,但当我点击条纹按钮时,模态显示默认数据量,即没有.

有人知道怎么做吗?

视图(表单,选择输入未显示)

<div class="stripe-controls" align="center">
  <script src="https://button.stripe.com/v1/button.js" class="stripe-button"
      data-key="ENV['STRIPE_PUBLIC_KEY'] %>" data-amount="">
  </script>
</div>
Run Code Online (Sandbox Code Playgroud)

CoffeeScript的

$ ->
  $('#order_quantity').click(orderTotal)
  orderTotal()

orderTotal = ->
  quantity = $('#order_quantity').val()
  price = $('#ticket-price').data('url')
  total = quantity * price
  $('.stripe-button').attr('data-amount', total)
  alert total
Run Code Online (Sandbox Code Playgroud)

javascript jquery coffeescript stripe-payments

9
推荐指数
1
解决办法
5467
查看次数

传递application_fee时出现Stripe API错误

我正在尝试使用Stripe API收取申请费.我确信我在请求中遗漏了一些东西.

条带投诉它需要以下任一项:OAuth密钥,Stripe-Account标头或目标参数.

我正在传球Stripe-Account.

你能指点我正确的方向吗?

这是我的卷曲请求:

curl https://api.stripe.com/v1/charges \
    -u sk_test_<key>: \
    -H "Stripe-Account: acct_<key>" \
    -d amount=2000 -d currency=usd -d capture=true \
    -d card=tok_<key> -d description="curl" -d application_fee=48
Run Code Online (Sandbox Code Playgroud)

以下是我得到的回复:

{
  "error": {
    "type": "invalid_request_error",
    "message": "Can only apply an application_fee when the request is made on behalf of another account (using an OAuth key, the Stripe-Account header, or the destination parameter).",
    "param": "application_fee"
  }
}
Run Code Online (Sandbox Code Playgroud)

stripe-payments stripe-connect

9
推荐指数
1
解决办法
3839
查看次数

条纹不会在测试模式下拒绝任何卡

我正在使用Stripe和Laravel 5.1,除了当我输入一个应该被拒绝的测试卡号码时我没有任何错误; 也就是说,即使它应该存在,也不会存在共振.

我收到一个令牌,好像一切都很顺利(例如:tok_16Y3wFAMxhd2ngVpHnky8VWX)

无论我使用什么测试卡,stripeResponseHandler()函数都不会在响应中返回错误.这是有问题的代码:

var PublishableKey = 'pk_test_Ed0bCarBWsgCXGBtjEnFeBVJ'; // Replace with your API publishable key
Stripe.setPublishableKey(PublishableKey);

/* Create token */
var expiry = $form.find('[name=cardExpiry]').payment('cardExpiryVal');
var ccData = {
    number: $form.find('[name=cardNumber]').val().replace(/\s/g, ''),
    cvc: $form.find('[name=cardCVC]').val(),
    exp_month: expiry.month,
    exp_year: expiry.year
};

Stripe.card.createToken(ccData, function stripeResponseHandler(status, response) {
    console.log(status);
    if (response.error) {
        /* Visual feedback */
        $form.find('[type=submit]').html('Please Try Again');
        /* Show Stripe errors on the form */
        $form.find('.payment-errors').text(response.error.message);
        $form.find('.payment-errors').closest('.row').show();
    } else {
        /* Visual feedback */
        $form.find('[type=submit]').html('Processing <i class="fa fa-spinner fa-pulse"></i>');
        /* Hide Stripe …
Run Code Online (Sandbox Code Playgroud)

jquery laravel stripe-payments

9
推荐指数
1
解决办法
2469
查看次数

检查现有条带客户的卡是否仍然有效

我有一个使用Stripe的应用程序.Stripe为每位客户存储信用卡信息.其中一些卡已经过期,不再有效.

我如何通过所有客户并验证他们的信用卡(如果他们仍然有效)?

stripe-payments

9
推荐指数
1
解决办法
4838
查看次数

条带中的 $0/免费交易

我在 Stripe 中构建了一个凭证/优惠券系统,并有以下场景。

客户代金券价值:50 美元
商品价格:25 美元

代金券系统计算出客户必须支付的总金额为 0 美元,他们的代金券代码中剩余 25 美元。

我的问题是,我无法在 Stripe 上收取 0 美元的费用,尽管我真的很想保留这一点,因为所有费用的处理方式都是因为客户的履行系统将 Stripe 用于它需要的其他信息,例如送货地址。

有谁知道是否可以使用 Stripe 处理 $0 或免费费用?

感谢您的帮助。

payment payment-gateway payment-processing stripe-payments

9
推荐指数
1
解决办法
3267
查看次数

Stripe Checkout泄漏内存吗?

我看到的问题是,当您使用规范的"自定义"指南将Stripe Checkout加载到页面中,对其进行配置,然后打开和关闭它几次,浏览器内存使用量会不断跳跃.有时,sorta会稍微释放,但残留总是会增长.在一个长期存在的页面/ SPA上,最终会有东西爬行.

  1. 使用--enable-precise-memory-info标记启动Google Chrome (无论是否带有此标记,都会出现问题)
  2. 复制其网站上的"自定义"示例:https://stripe.com/docs/checkout#integration-custom(或使用您自己的设置,结果相同).
  3. 点击"购买"按钮(或触发你的按钮stripeInstance.open(cfg)),摆弄弹出窗口,关闭.
  4. 重复步骤3,逐渐观察记忆

您可以使用memory-stats.js或仅在(Chrome)控制台中运行来观看内存:

performance.memory.usedJSHeapSize
Run Code Online (Sandbox Code Playgroud)

我确信这必须是"我"而不是条纹.他们不会泄漏如此糟糕的事件openclose事件吗?


编辑:这是一个JS小提琴,它可以复制他们的演示代码:https://jsfiddle.net/p1Lfuewt/

还有一个5秒间隔的内存屏幕截图,基本上只需点击"购买"即可打开和关闭它们的小部件(不知道那个承诺错误是什么,就是这些):

内存泄漏

javascript memory-leaks google-chrome stripe-payments

9
推荐指数
1
解决办法
217
查看次数

条纹元素 - 'card-element' 布局的变化

我正在寻找一种方法来自定义“卡号”“到期日期”和“CCV”字段的布局,当使用条纹元素并card.mount('#card-element');按照本页第一个示例中所述注入这些字段https://stripe.com/文档/条纹-js

它将所有卡片字段放在一行中,我想更改该布局并将它们放在不同的行中。

有任何想法吗?

提前致谢

stripe-payments react-stripe-elements

9
推荐指数
1
解决办法
2330
查看次数

如何在 Stripe 中更新客户默认支付方式?

假设我们已经创建了一种付款方式 - pm_xxx。当我们创建客户时,我们可以通过java代码将此方法作为默认付款方式附加到客户:

CustomerCreateParams.Builder customerCreateParamsBuilder = CustomerCreateParams.builder()
                    .setEmail(email)
                    .setPaymentMethod('pm_xxx');       
Customer.create(customerCreateParamsBuilder.build());
Run Code Online (Sandbox Code Playgroud)

不幸的是,更新客户的相应 api 不可用。所以问题是在 Stripe 中更新客户默认付款方式的首选方式是什么?

编辑:基于@karllekko 的回答,因为我的用例是定期付款,所以我结合了 2 个操作:将客户附加到付款方式:

paymentMethod.attach(PaymentMethodAttachParams.builder().setCustomer(customer.getId()).build());            
Run Code Online (Sandbox Code Playgroud)

并为客户发票设置默认付款方式:

customer.update(CustomerUpdateParams.builder().setInvoiceSettings(CustomerUpdateParams.InvoiceSettings.builder().setDefaultPaymentMethod(token).build()).build());
Run Code Online (Sandbox Code Playgroud)

java stripe-payments

9
推荐指数
2
解决办法
1万
查看次数

STRIPE 错误:为了使用 Checkout,您必须在 https://dashboard.stripe.com/account 上设置帐户或公司名称

我发现此错误消息:

“要使用 Checkout,您必须在https://dashboard.stripe.com/account 上设置帐户或公司名称

开发条带连接时多次。但是我的帐户和公司名称设置没问题。

stripe-payments

9
推荐指数
2
解决办法
3234
查看次数