Lewati ke konten utama

getAccountById

Dapatkan satu objek akun pembayaran berdasarkan pengidentifikasinya. 🔐 Metode ini memerlukan otorisasi.

Deskripsi

Metode ini mendapatkan satu objek akun pembayaran berdasarkan pengidentifikasinya. Ini mengembalikan sebuah Promise yang menyelesaikan menjadi objek akun pembayaran IAccountsEntity.

Pembayaran.getAccountById(

id*

);

Skema parameter

Skema

id(diperlukan): number
Pengidentifikasi objek akun pembayaran yang diambil
contoh: 12345

Contoh

Contoh minimal

const response = await Payments.getAccountById(1764);

Contoh dengan pengaturan untuk stripe

const settings = {
"stripeAccountId": "acct_1RsDXzHy1QOsjfBI",
"stripeOnboardingComplete": true,
"stripePublishableKey": "pk_test_51OO...Y7MS3",
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"sessionTimeout": 15
};
const response = await Payments.getAccountById(1764, settings);

Contoh dengan pengaturan untuk yookassa

const settings = {
"shopId": "1234567",
"secretKey": "test_pazk0r3JNlMEEwQq6t3Syk-qapXL0ArHvdXYxtaDvcv",
"successUrl": "https://example.com/success",
"cancelUrl": "https://example.com/cancel",
"sessionTimeout": 15
};
const response = await Payments.getAccountById(1764, settings);

Contoh respons

{
"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"
}

Skema respons

Skema: IAccountsEntity

id: number
Pengidentifikasi objek.
contoh: 12345

localizeInfos: ILocalizeInfo
Deskripsi Json dari objek akun pembayaran.

identifier: string
Pengidentifikasi teks untuk bidang pencatatan.
contoh: "payment_12345"

type: 'stripe' | 'custom'
Tipe dapat berupa 'stripe' atau 'custom'.
contoh: 'stripe'

isVisible: boolean
Indikator visibilitas akun pembayaran.
contoh: true

isUsed: boolean
Indikator penggunaan akun pembayaran.
contoh: false

testMode: boolean
Menunjukkan apakah akun pembayaran dalam mode uji.
contoh: true

settings: IPaymentAccountSettings
Pengaturan akun pembayaran.
contoh:

{ "status": "connected" }

settings.status: string
Status koneksi akun pembayaran langsung (non-uji).
contoh: "connected"

testSettings: object
Pengaturan mode uji untuk akun pembayaran.

updatedDate: string
Tanggal modifikasi objek.
contoh: "2025-02-26T10:13:16.839Z"