انتقل إلى المحتوى الرئيسي

getAccountById

احصل على كائن حساب الدفع واحد بواسطة معرفه. 🔐 تتطلب هذه الطريقة التفويض.

تسترجع هذه الطريقة كائن حساب دفع واحد بواسطة معرفه. تعيد Promise التي تحل إلى كائن حساب الدفع.

المدفوعات.getAccountById( id, settings );

مثال بسيط

const value = await Payments.getAccountById(1764);

مثال مع إعدادات لـ 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 value = await Payments.getAccountById(1764, settings);

مثال مع إعدادات لـ yookassa

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

مخطط المعلمات

المخطط

id(required): number
معرف كائن حساب الدفع المسترجع
مثال: 12345

settings(required): any
كائن الإعدادات
مثال: !!!

مثال على الاستجابة

{
"id": 1,
"localizeInfos": {
"en_US": {
"title": "Cash"
}
},
"identifier": "cash",
"type": "custom",
"isVisible": true,
"isUsed": true
}

مخطط الاستجابة

المخطط: IAccountsEntity

id: number
معرف الكائن.
مثال: 12345

localizeInfos: ILocalizeInfo
وصف Json لكائن حساب الدفع.

identifier: string
معرف نصي لحقل التسجيل.
مثال: "payment_12345"

type: 'stripe' | 'custom'
يمكن أن يكون النوع 'stripe' أو 'custom'.
مثال: 'stripe'

isVisible: boolean
مؤشر الرؤية لحساب الدفع.
مثال: true

isUsed: boolean
مؤشر الاستخدام لحساب الدفع.
مثال: false