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(zorunlu): 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": {
"title": "Cash"
},
"type": "custom",
"isUsed": true,
"testMode": true,
"settings": {
"status": "connected"
},
"testSettings": {
"status": "connected"
},
"updatedDate": "2025-02-25T08:55:43.957Z"
}

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

testMode: boolean
Ödeme hesabının test modunda olup olmadığını gösterir.
örnek: true

settings: IPaymentAccountSettings
Ödeme hesabı ayarları.
örnek: { "status": "connected" }

settings.status: string
Canlı (test olmayan) ödeme hesabının bağlantı durumu.
örnek: "connected"

testSettings: object
Ödeme hesabı için test modu ayarları.

updatedDate: string
Nesne değiştirilme tarihi.
örnek: "2025-02-26T10:13:16.839Z"