小编Ali*_*der的帖子

'file.existsSync()':不正确

我将在 firebase 存储中存储图像。当我通过图像选择器发送文件时,它工作正常。但是当我手动传递图像链接时,它显示一个错误:

'package:firebase_storage/src/storage_reference.dart': 
Failed assertion: line 62 pos 12: 'file.existsSync()': is not true.
Run Code Online (Sandbox Code Playgroud)

我正在编写以下代码:

File image =  File("assets/img/pic.jpg");

final StorageReference firebaseStorageRef =
        FirebaseStorage.instance.ref().child('image');

InkWell(
            child: Text("Tap to Upload"),
            onTap: () {
              firebaseStorageRef.putFile(image);
            },
          ),
Run Code Online (Sandbox Code Playgroud)

flutter firebase-storage

5
推荐指数
1
解决办法
7607
查看次数

未定义付款意图:TypeScript

我正在关注 stripe 官方文档来集成订阅模块。但我在编写相同的代码时遇到错误:

未定义付款意图:TypeScript

错误:类型“string | ”上不存在属性“ payment_intent” 发票'。类型“string”上不存在属性“ payment_intent”。ts(2339)

exports.doSubscribe = functions.https.onRequest(async (data, res) => {
  try {
    ///Create Customer
    const customer = await stripe.customers.create({
      description: 'My First Test Customer (created for API docs at https://www.stripe.com/docs/api)',
    });
   

    ///Create Payment Method
    const paymentMethod = await stripe.paymentMethods.create({
      type: 'card',
      card: {
        number: '4242424242424242',
        exp_month: 10,
        exp_year: 2023,
        cvc: '314',
      },
    });


    ///Attach Payment Method with Customer
    await stripe.paymentMethods.attach(
      paymentMethod.id,
        {customer:customer.id}
      );

    ///Crate Product
    const product = await stripe.products.create({
      name: 'Gold Special', …
Run Code Online (Sandbox Code Playgroud)

stripe-payments

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