1. 新增發票狀態機(pending/issued/failed/void)與冪等鍵 relate_number,並補上 last_checked_at、retry_count、voided_at、void_reason 欄位(migration 全欄位 nullable/有預設,對既有資料零影響並回填既有狀態)。 2. finalize 帶入發票輸入時改為先建 pending 發票,commit 後派發 IssueInvoiceJob 非同步向綠界開立,避免在交易內等待 ECPay 造成長交易。 3. 新增 EcpayInvoiceService 封裝綠界 B2C API(GetIssue 查詢、Issue 補開、Invalid 作廢),金鑰仍取自各機台 payment_configs。 4. 新增 invoices:reconcile 排程指令,每 5 分鐘對 pending 發票以 RelateNumber 向綠界 GetIssue 查證,補登 issued 或標記 failed 待補開。 5. SalesController 新增 reconcileInvoice/reissueInvoice/voidInvoice 三個後台操作端點與對應路由。 6. 發票列表改以 created_at 篩選(pending/failed 尚無 invoice_date 也能顯示),新增狀態過濾器與查詢/補開/作廢操作按鈕,狀態徽章改以狀態機顯示。 7. recordInvoice 改以 flow_id updateOrCreate 收斂,避免重送產生重複發票列;查詢機台/訂單時加上 withoutGlobalScopes。 8. 同步新增相關三語系字串並加入 ecpay_invoice base_url 設定。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
||
|
||
return [
|
||
|
||
/*
|
||
|--------------------------------------------------------------------------
|
||
| Third Party Services
|
||
|--------------------------------------------------------------------------
|
||
|
|
||
| This file is for storing the credentials for third party services such
|
||
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||
| location for this type of information, allowing packages to have
|
||
| a conventional file to locate the various service credentials.
|
||
|
|
||
*/
|
||
|
||
'mailgun' => [
|
||
'domain' => env('MAILGUN_DOMAIN'),
|
||
'secret' => env('MAILGUN_SECRET'),
|
||
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
||
'scheme' => 'https',
|
||
],
|
||
|
||
'postmark' => [
|
||
'token' => env('POSTMARK_TOKEN'),
|
||
],
|
||
|
||
'ses' => [
|
||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||
],
|
||
|
||
// 綠界電子發票 B2C API(後台對帳/補開/作廢)。金鑰仍取自各機台 payment_configs.ecpay_invoice;
|
||
// 此處僅控制 API 網域。留空(未設 env)時由 EcpayInvoiceService 依環境 fail-safe:
|
||
// 正式環境才用 https://einvoice.ecpay.com.tw,其餘走 https://einvoice-stage.ecpay.com.tw。
|
||
'ecpay_invoice' => [
|
||
'base_url' => env('ECPAY_INVOICE_BASE_URL'),
|
||
],
|
||
|
||
];
|