getAccounts
Lấy tất cả các tài khoản thanh toán dưới dạng mảng.
Mô tả
Phương thức này lấy tài khoản thanh toán dưới dạng một mảng. Nó trả về một Promise mà khi hoàn thành sẽ trả về một đối tượng tài khoản thanh toán IAccountsEntity.
Payments.getAccounts();
Ví dụ
Ví dụ tối thiểu
const response = await Payments.getAccounts();
Phản hồi ví dụ
[
{
"id": 3,
"identifier": "stripe",
"isVisible": true,
"localizeInfos": {
"title": "Stripe"
},
"type": "stripe",
"isUsed": true,
"testMode": true,
"settings": {
"status": "not_connected"
},
"testSettings": {
"status": "connected",
"cancelUrl": "https://your-project.oneentry.cloud/",
"successUrl": "https://your-project.oneentry.cloud/",
"sessionTimeout": 15,
"stripeAccountId": "acct_1QwkKrAcSoNc7iev",
"signingSecretKey": "whsec_erL2VHfoVel9RoPNTSa0Yg23UsVbZjkG",
"stripeRedirectUrl": "https://connect.stripe.com/setup/s/acct_1QwkKrAcSoNc7iev/P86lOscuMN2o",
"stripePublishableKey": "pk_test_51Say4J2eHDtEbbediqZlslL2q7UN3MurGPHNm8m0IGGCh0QQqbu2ILQUqW7WiWWZtF9Iq5FVDvBXacRcKinEDHc900OQ7n6SUk",
"useWebHookValidation": true,
"stripeOnboardingComplete": true
},
"updatedDate": "2025-02-26T13:04:12.806Z"
},
{
"id": 2,
"identifier": "paypal",
"isVisible": true,
"localizeInfos": {
"title": "PayPal"
},
"type": "custom",
"isUsed": false,
"testMode": true,
"settings": {
"status": "connected"
},
"testSettings": {
"status": "connected"
},
"updatedDate": "2025-02-25T08:56:32.384Z"
},
{
"id": 1,
"identifier": "cash",
"isVisible": true,
"localizeInfos": {
"title": "Cash"
},
"type": "custom",
"isUsed": true,
"testMode": true,
"settings": {
"status": "connected"
},
"testSettings": {
"status": "connected"
},
"updatedDate": "2025-02-25T08:55:43.957Z"
}
]
Sơ đồ phản hồi
Sơ đồ: IAccountsEntity
id: số
Định danh đối tượng.
ví dụ: 12345
localizeInfos: ILocalizeInfo
Mô tả Json của đối tượng tài khoản thanh toán.
identifier: chuỗi
Định danh văn bản cho trường ghi.
ví dụ: "payment_12345"
type: 'stripe' | 'custom'
Loại có thể là 'stripe' hoặc 'custom'.
ví dụ: 'stripe'
isVisible: boolean
Chỉ báo khả năng hiển thị của tài khoản thanh toán.
ví dụ: true
isUsed: boolean
Chỉ báo việc sử dụng của tài khoản thanh toán.
ví dụ: false
testMode: boolean
Chỉ ra liệu tài khoản thanh toán có ở chế độ thử nghiệm hay không.
ví dụ: true
settings: IPaymentAccountSettings
Cài đặt tài khoản thanh toán.
ví dụ: { "status": "connected" }
settings.status: chuỗi
Tình trạng kết nối của tài khoản thanh toán trực tiếp (không phải thử nghiệm).
ví dụ: "connected"
testSettings: đối tượng
Cài đặt chế độ thử nghiệm cho tài khoản thanh toán.
updatedDate: chuỗi
Ngày sửa đổi đối tượng.
ví dụ: "2025-02-26T10:13:16.839Z"