Implement收款详情与收款记录 pages with pay-code API, QR generation, amount setting, and record grouping so merchants can collect payments from the home quick action. Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.0 KiB
Swift
39 lines
1.0 KiB
Swift
//
|
||
// PaymentAPI.swift
|
||
// suixinkan
|
||
//
|
||
|
||
import Foundation
|
||
|
||
@MainActor
|
||
/// 收款相关 API,封装摄影师收款码与收款记录接口。
|
||
final class PaymentAPI {
|
||
private let client: APIClient
|
||
|
||
init(client: APIClient) {
|
||
self.client = client
|
||
}
|
||
|
||
/// 拉取当前景区的静态/动态支付 URL。
|
||
func payCode(scenicId: Int) async throws -> PayCodeResponse {
|
||
try await client.send(
|
||
APIRequest(
|
||
method: .get,
|
||
path: "/api/yf-handset-app/photog/pay-code",
|
||
queryItems: [URLQueryItem(name: "scenic_id", value: String(scenicId))]
|
||
)
|
||
)
|
||
}
|
||
|
||
/// 拉取近 7 天收款记录。
|
||
func collectionRecord(scenicId: Int) async throws -> RepaymentCollectionRecordResponse {
|
||
try await client.send(
|
||
APIRequest(
|
||
method: .get,
|
||
path: "/api/yf-handset-app/photog/order/photo-scan-order-list",
|
||
queryItems: [URLQueryItem(name: "scenic_id", value: String(scenicId))]
|
||
)
|
||
)
|
||
}
|
||
}
|