Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/407.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 流星问题条纹退款(银河:条纹)_Javascript_Meteor_Stripe Payments - Fatal编程技术网

Javascript 流星问题条纹退款(银河:条纹)

Javascript 流星问题条纹退款(银河:条纹),javascript,meteor,stripe-payments,Javascript,Meteor,Stripe Payments,如何使用mrgalaxy:stripe进行退款 Stripe.refunds.create(refund, function(err, receipt) { ... }); 在模拟调用'rejectUserFromProject'类型错误的效果时导致了异常:无法读取未定义(…)类型错误的属性'create':无法读取未定义的属性'create' 我使用StripeCheckout进行收费,但找不到是否有退款方法: StripeCheckout.open({ key: _key,

如何使用mrgalaxy:stripe进行退款

Stripe.refunds.create(refund, function(err, receipt) {
  ...
});
在模拟调用'rejectUserFromProject'类型错误的效果时导致了
异常:无法读取未定义(…)类型错误的属性'create':无法读取未定义的属性'create'

我使用StripeCheckout进行收费,但找不到是否有退款方法:

StripeCheckout.open({
    key: _key,
    amount: fee * 100,
    currency: 'usd',
    name: 'name',
    description: 'description',
    panelLabel: 'label',
    token: function(receipt) {
      console.info(receipt);
  });

签出是cc事务的UX/UI模块,处理取决于服务器端库或调用,其中身份验证包括服务器机密(即签出使用公钥)

mrgalaxy:meteor包含Node.js Stripe API,但是,我没有很好地利用我的时间。。更好的解决方案是从那里使用API

现在的黑客是导入Stripe npm包,然后

使用Stripe dep创建了一个
package.json
文件,代码最后显示:

if (Meteor.isServer) {
  var stripe = Meteor.npmRequire("stripe")(
    Meteor.settings.private.testSecretKey
  );

  stripe.refunds.create(returnObj, function(err, refund) {
    // asynchronously called
    if (err) {
      // handle
    };
  });
};
此外,由于代码是在回调中执行的,因此使用Meteor或其他基于promise的方法可能会出现问题,可能会在父范围中赋值,尽管我没有尝试过,因此需要按原样使用光纤进行封装:

stripe.refunds.create({
  // ...
}, Meteor.bindEnvironment(function (err, refund) {
  // ...
}));
最后,Meteor 1.3支持npm集成,因此您不必使用任何不熟悉的东西:

if (Meteor.isServer) {
  var stripe = require("stripe")(
    Meteor.settings.private.testSecretKey
  );

  stripe.refunds.create(returnObj, function(err, refund) {
    // asynchronously called
    if (err) {
      // handle
    };
  });
};