AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-218725

Zabs's questions

Martin Hope
Zabs
Asked: 2024-02-01 19:31:33 +0800 CST

PHPStan 错误 - Property App\Models\Report::$succeeded_at (Carbon\Carbon|null) 不接受 int|null

  • 5

我在 Laravel 10 应用程序中使用 PHPStan 并将其设置为相当高的级别(我猜是很好的做法) - 我遇到了一些错误,我正在尝试找出解决它们的最佳方法。

 ------ ------------------------------------------------------------------------------------------ 
  Line   app/Actions/Reports/SetReportStatusAction.php                                             
 ------ ------------------------------------------------------------------------------------------ 
  17     Property App\Models\Report::$succeeded_at (Carbon\Carbon|null) does not accept int|null.  
<?php

declare(strict_types=1);

namespace App\Actions\Reports;

use App\Models\Report;
use Stripe\Reporting\ReportRun;

class SetReportStatusAction
{
    public function __invoke(Report $report): void
    {
        /** @var ReportRun $stripeObject */
        $stripeObject = $report->getStripeObject();
        $report->status = $stripeObject->status;
        $report->succeeded_at = $stripeObject->succeeded_at ?? null;
    }
}

报告.php

<?php

namespace App\Models;

// use statements hidden from view

class Report extends Model implements Transitionable
{
    use HasFactory, HasStates, HasStripeObject;

    protected $fillable = [
        'stripe_id',
        'report_type',
        'status',
        'parameters',
        'expires_at',
        'succeeded_at',
    ];

    protected $casts = [
        'parameters' => 'json',
        'expires_at' => 'datetime',
        'succeeded_at' => 'datetime',
    ];
}

数据succeeded_at来自 webhook 事件,格式与此类似 - 时间戳

"succeeded_at": 1706786551

预期结果 - PHPStan 检测到相关两个文件没有错误

实际结果 - 收到 phpstan 错误“Property App\Models\Report::$succeeded_at (Carbon\Carbon|null) 不接受 int|null”。

  • 1 个回答
  • 32 Views
Martin Hope
Zabs
Asked: 2024-01-22 16:52:49 +0800 CST

Stripe Reporting API csv 文件返回有效标题但没有行?

  • 5

我正在通过 Postman 使用 Stripe API 来检索报告 API 数据,在本例中,我正在尝试检索 - 正如您从我在标题下方下载的文件中看到的那样,标题显示正确,并且我已经在我的帐户中完成了各种成功的交易。测试 Stripe 帐户。

当我尝试直接从仪表板下载支付文件时,这些文件中都包含有效的标题和数据行,但是当我通过 API 执行此操作时,它似乎返回空行,如下所示。

CSV 输出

我已经创建了报告运行并设置了时间日期,然后使用{{baseUrl}}/v1/reporting/report_runs/frr_1OYsDeHpBAlTJ9LaKaZJPWCn请求得到以下输出:

{
    "id": "frr_1OYsDeHpBAlTJ9LaKaZJPWCn",
    "object": "reporting.report_run",
    "created": 1705333018,
    "error": null,
    "livemode": false,
    "parameters": {
        "interval_end": 1705276800,
        "interval_start": 1702944000
    },
    "report_type": "payout_reconciliation.itemized.5",
    "result": {
        "id": "file_1OYsE0HpBAlTJ9LaHP83ElFn",
        "object": "file",
        "created": 1705333040,
        "expires_at": 1736869040,
        "filename": "frr_1OYsDeHpBAlTJ9LaKaZJPWCn.csv",
        "links": {
            "object": "list",
            "data": [
                {
                    "id": "link_1OYtbbHpBAlTJ9LaAhALJNLt",
                    "object": "file_link",
                    "created": 1705338347,
                    "expired": false,
                    "expires_at": null,
                    "file": "file_1OYsE0HpBAlTJ9LaHP83ElFn",
                    "livemode": false,
                    "metadata": {},
                    "url": "https://files.stripe.com/links/MDB8YWNjdF8xT1A0clRIcEJBbFRKOUxhfGZsX3Rlc3RfZWJkVnowU1JkNEh3VW1JTHEwdDJoeWhi00LKHMAhaA"
                },
                {
                    "id": "link_1OYta2HpBAlTJ9LaVmCJZDUV",
                    "object": "file_link",
                    "created": 1705338250,
                    "expired": false,
                    "expires_at": null,
                    "file": "file_1OYsE0HpBAlTJ9LaHP83ElFn",
                    "livemode": false,
                    "metadata": {},
                    "url": "https://files.stripe.com/links/MDB8YWNjdF8xT1A0clRIcEJBbFRKOUxhfGZsX3Rlc3RfcXlhTm9LdXR0ekRoWWx6UWJ0eTBUcngz00Bjfm8xi2"
                }
            ],
            "has_more": false,
            "url": "/v1/file_links?file=file_1OYsE0HpBAlTJ9LaHP83ElFn"
        },
        "purpose": "finance_report_run",
        "size": 170,
        "title": "FinanceReportRun frr_1OYsDeHpBAlTJ9LaKaZJPWCn",
        "type": "csv",
        "url": "https://files.stripe.com/v1/files/file_1OYsE0HpBAlTJ9LaHP83ElFn/contents"
    },
    "status": "succeeded",
    "succeeded_at": 1705333040
}

当我下载 URL 中的文件时 - 它只有 CSV 标题行为空行?我究竟做错了什么?任何想法.. https://files.stripe.com/v1/files/file_1OYsE0HpBAlTJ9LaHP83ElFn/content

stripe-payments
  • 1 个回答
  • 17 Views
Martin Hope
Zabs
Asked: 2024-01-15 21:59:25 +0800 CST

Stripe Reporting API - 尝试使用 Stripe CLI 检索报告数据

  • 5

我正在使用 Stripe 付款进行即将到来的集成,并且我已经设置了 Stripe CLI,以便我可以使用我的终端与我的测试设置进行通信,这一切都工作正常。

我正在尝试运行一些报告来检索一些付款对账数据

stripe reporting report_types retrieve payout_reconciliation.itemized.5

这将返回以下响应

{
  "id": "payout_reconciliation.itemized.5",
  "object": "reporting.report_type",
  "data_available_end": 1705276800,
  "data_available_start": 1702944000,
  "default_columns": [
    "automatic_payout_id",
    "automatic_payout_effective_at",
    "balance_transaction_id",
    "created",
    "available_on",
    "currency",
    "gross",
    "fee",
    "net",
    "reporting_category",
    "description"
  ],
  "livemode": false,
  "name": "Itemized payout reconciliation",
  "updated": 1705302416,
  "version": 5
}

所以我知道我的 CLI 已设置,但我想使用参数按开始和结束日期进行过滤 - 通过执行以下操作

stripe reporting report_types retrieve payout_reconciliation.itemized.5 --interval_start=1702944000 --interval_end=1705276800

我在这里使用条纹报告文档 - https://stripe.com/docs/reports/report-types/payout-reconciliation 在此输入图像描述

当我使用开始日期和结束日期运行以下命令时,出现错误?

$ stripe reporting report_types retrieve payout_reconciliation.itemized.5 --interval_start=1702944000 --interval_end=1705276800
unknown flag: --interval_start

我很困惑,因为根据 API 文档,参数似乎是正确的 - 我做错了什么?

stripe-payments
  • 1 个回答
  • 20 Views
Martin Hope
Zabs
Asked: 2023-11-21 00:53:11 +0800 CST

使用 NOT EXISTS() 时 MySQL 查询错误

  • 6

我正在尝试NOT EXISTS在旧系统(运行 MySQL 4.x)上利用 MySQL 函数运行 MySQL 查询,下面是一个简单的查询,它从两个表(带有一个 INNER JOIN)返回几列。

注意customerId和accountId是相同的值..这是一个非常旧的系统:(

SELECT d.customerId, d.customerName, a.status
    FROM DetailedDebtorsData AS d 
    INNER JOIN accounts AS a ON a.account_uid = d.customerId
    ORDER BY d.date ASC;
+---------------+----------------------+--------+
| customerId    | customerName         | status |
+---------------+----------------------+--------+
|        145060 | Alan Smith           | active |
|         68742 | John Doe             | active |
+---------------+----------------------+--------+

我有另一个表,我将用作“例外”表,本质上,如果在例外表中找到 customerId(及其排除项中的相关 account_id 列),那么我不想从DetailedDebtors 返回相关account_payment_terms行上表。

account_payment_terms表(用于排除)

mysql> SELECT account_id, created_date FROM account_payment_terms;
+------------+---------------------+
| account_id | created_date        |
+------------+---------------------+
|     145060 | 2023-11-20 13:23:03 |
+------------+---------------------+

由于 account_id145060存在于accountPaymentTerms表中,因此我不想返回DetailedDebtors要返回的表中的关联行(具有相同的 145060 id)。

这是我尝试使用 NOT EXISTS() 执行的查询

SELECT d.customerId, d.customerName, a.status
    FROM DetailedDebtorsData AS d 
    INNER JOIN accounts AS a ON a.account_uid = d.customerId
    WHERE NOT EXISTS (
        SELECT 1
        FROM account_payment_terms AS apt
        WHERE apt.account_id = d.customerId
    )        
    ORDER BY d.date ASC;

这个错误并给出了以下错误,但我希望 WHERE NOT EXISTS 仅返回一行,即不在表中的行account_payment_terms。

MySQL 返回错误

ERROR 1064 (HY000): You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTS (
        SELECT 1
        FROM account_payment_terms AS

预期结果(返回 1 行)

+---------------+----------------------+--------+
| accountId     | customerName         | status |
+---------------+----------------------+--------+
|         68742 | John Doe             | active |
+---------------+----------------------+--------+

实际结果(返回 2 行)

+---------------+----------------------+--------+
| accountId     | customerName         | status |
+---------------+----------------------+--------+
|        145060 | Alan Smith           | active |
|         68742 | John Doe             | active |
+---------------+----------------------+--------+

我究竟做错了什么?

sql
  • 1 个回答
  • 50 Views
Martin Hope
Zabs
Asked: 2023-10-15 21:41:52 +0800 CST

无法再通过 SSH 访问我的 AWS Lightsail 实例错误:身份验证器提供程序 $SSH_SK_PROVIDER 未解析;禁用

  • 5

由于某种原因,我无法再通过 SSH 连接到我的 Amazon Lightsail 实例(昨天在同一台计算机上还可以)。

连接到我的实例时出现错误

~ ssh [email protected] -vvv
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/gavin/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 172.26.14.190 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/gavin/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/gavin/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug3: ssh_connect_direct: entering
debug1: Connecting to 172.26.14.190 [172.26.14.190] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: connect to address 172.26.14.190 port 22: Operation timed out
ssh: connect to host 172.26.14.190 port 22: Operation timed out

是什么Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling以及是什么导致了这种情况的发生?

注意。我可以使用基于 AWS 浏览器的 SSH 连接工具进行良好连接

  • 2 个回答
  • 19 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve