getAccountById
Bir ödeme hesap nesnesini tanımlayıcısı ile alın. 🔐 Bu yöntem yetkilendirme gerektirir.
Bu yöntem, bir ödeme hesap nesnesini tanımlayıcısı ile alır. Bir ödeme hesap nesnesine çözülme sağlayan bir Promise döner.
Ödemeler.getAccountById(
id,
settings
);
Minimal örnek
const value = 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 value = 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 value = await Payments.getAccountById(1764, settings);
Parametreler şeması
Şema
id(gerekli): number
Alınan ödeme hesap nesnesinin tanımlayıcısı
örnek: 12345
settings(gerekli): any
Ayarlar nesnesi
örnek: !!!
Örnek yanıt
{
"id": 1,
"localizeInfos": {
"en_US": {
"title": "Nakit"
}
},
"identifier": "cash",
"type": "custom",
"isVisible": true,
"isUsed": true
}
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ı.
ö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