Ana içeriğe geç

getAccountById

Bir ödeme hesap nesnesini tanımlayıcısına göre alın. 🔐 Bu yöntem yetkilendirme gerektirir.

Açıklama

Bu yöntem, bir ödeme hesap nesnesini tanımlayıcısına göre alır. Bir ödeme hesap nesnesi IAccountsEntity döndüren bir Promise döner.

Ödemeler.getAccountById(

id

);

Parametreler şeması

Şema

id(gerekli): number
Alınan ödeme hesap nesnesinin tanımlayıcısı
örnek: 12345

Örnekler

Minimal örnek

const response = await Payments.getAccountById(1764);

Stripe için ayarlarla örnek

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);

Yookassa için ayarlarla örnek

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);

Örnek yanıt

{
"id": 1,
"identifier": "cash",
"isVisible": true,
"localizeInfos": {
"en_US": {
"title": "Nakit"
}
},
"type": "custom",
"isUsed": true,
"testMode": true,
"settings": {},
"testSettings": {}
}

Yanıt şeması

Şema: IAccountsEntity

id: number
Nesne tanımlayıcısı.
örnek: 12345

localizeInfos: ILocalizeInfo
Ödeme hesap nesnesinin Json açıklaması.

identifier: string
Kayıt alanı için metin tanımlayıcısı.
örnek: "payment_12345"

type: 'stripe' | 'custom'
Tür 'stripe' veya 'custom' olabilir.
örnek: 'stripe'

isVisible: boolean
Ödeme hesabının görünürlük göstergesi.
örnek: true

isUsed: boolean
Ödeme hesabının kullanım göstergesi.
örnek: false