تحصيل قيمة بطاقة النقل العام
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكن تحصيل قيمة البطاقات على النحو التالي:
يمكنك اختياريًا فرض مستوى أمان إضافي عندما يحصّل المستخدمون قيمة البطاقة أو يستخدمونها. لمعرفة التفاصيل، يُرجى الاطّلاع على الحماية باستخدام قفل الشاشة.
مسح الرمز الشريطي ضوئيًا
ساعِد عملائك في مسح "بطاقتهم" ضوئيًا من خلال إرفاق رمز شريطي.
رمز شريطي ثابت
يمكنك عرض رمز شريطي ثابت من خلال ضبط object.barcode
.
توفر واجهة برمجة التطبيقات مجموعة متنوعة من أنواع الرموز الشريطية. لمزيد من التفاصيل، راجِع
النوع Barcode
.
رمز شريطي دوّار
لمزيد من الأمان، يمكنك عرض رمز شريطي دوّار من خلال ضبط السمة object.rotatingBarcode
. إنّ الرموز الشريطية الدوّارة تشبه الرموز الشريطية العادية، ولكنّها تتغير من وقت لآخر في العادة كل دقيقة، وتتم برمجة جهاز الدفع أو القارئ لقبول العرض الأحدث فقط. يحدّ هذا من المخاطر المرتبطة بأخذ لقطة الشاشة للرمز الشريطي، لا سيّما سرقة التذاكر أو إعادة بيع التذاكر غير المصرّح بها. لمزيد من التفاصيل، راجِع
النوع RotatingBarcode
.
صورة متحرّكة للأمان
هناك طريقة أخرى لمنع إساءة استخدام لقطات الشاشة، وهي عرض صورة متحركة أمنية للرمز الشريطي، والتي
تدعم عملية التحقق البشرية من البطاقة.
المظهر المادي للصور المتحركة الأمنية هو مخطط لامع حول الرمز الشريطي للبطاقة. لا يتم تشغيل هذه الصورة المتحركة المتلألئة إلا عندما يكون الجهاز متحرّكًا، ما يتيح للمستخدم اختبار
صلاحية البطاقة من خلال إمالة الجهاز. أمّا من ناحية أخرى، فإنّ حمل الجهاز ثابتًا سيؤدي إلى إضافة صور متحركة مفعمة بالألوان ومفعمة بالحيوية فقط.
لتفعيل صورة متحركة أمنية للبطاقة، اضبط السمة AnimationType
للحقل SecurityAnimation
على FOIL_SHIMMER
في فئة البطاقة.
انظر الشكل 1. أدناه لمشاهدة مثال حول كيفية ظهور الحركة الأمنية عند تفعيلها:
الشكل 1.
الحماية باستخدام قفل الشاشة
لحماية إمكانية وصول عميلك إلى "البطاقة"، يمكنك فرض قفل الشاشة في كل مرة يضيف فيها العميل بطاقتك أو يطّلع عليها. ويمكن إجراء ذلك من خلال ضبط class.viewUnlockRequirement
.
لمزيد من التفاصيل، راجِع
النوع ViewUnlockRequirement
.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-29 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-29 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003ePasses can be redeemed via barcode scan, with options for static or rotating barcodes for added security.\u003c/p\u003e\n"],["\u003cp\u003eRotating barcodes enhance security by changing periodically, minimizing risks associated with ticket theft or resale.\u003c/p\u003e\n"],["\u003cp\u003eSecurity animation provides another layer of protection by displaying a shimmering outline around the barcode, triggered by device motion.\u003c/p\u003e\n"],["\u003cp\u003eScreen lock can be enabled to further protect pass access, requiring user authentication upon adding or accessing the pass.\u003c/p\u003e\n"]]],["Passes can be redeemed via barcode scan. You can use a static barcode by setting `object.barcode` or enhance security with a rotating barcode by setting `object.rotatingBarcode`, which changes periodically. A security animation with a shimmering outline, enabled by setting `SecurityAnimation`'s `AnimationType` to `FOIL_SHIMMER`, can be used to prevent screenshot abuse. Additionally, you can require a screen lock for pass access by setting `class.viewUnlockRequirement`.\n"],null,["# Redeem a Transit pass\n\nPasses can be redeemed in the following way:\n\n- [Barcode scan](#use-show-and-scan).\n\nYou can optionally require extra security when users redeem or access their pass. For details,\nsee [Protect with Screen Lock](#protect-with-screen-lock).\n\nBarcode scan\n------------\n\nHelp your customers scan their Pass by attaching a barcode.\n\n### Static barcode\n\nYou can display a static barcode by setting `object.barcode`.\nThe API provides a variety of barcode types. For more details, see the\n[`Barcode` type](/wallet/tickets/transit-passes/qr-code/rest/v1/Barcode).\n\n### Rotating barcode\n\n\nFor additional security, you can display a rotating barcode by setting\n`object.rotatingBarcode`. Rotating barcodes look just like regular barcodes but\nchange periodically, typically every minute, and the terminal/reader is programmed to only\naccept the most recent one. This reduces the risks associated with barcode screenshotting, in\nparticular ticket theft or unauthorized ticket resale. For more details, see the\n[`RotatingBarcode` type](/wallet/tickets/transit-passes/qr-code/rest/v1/RotatingBarcode).\n\n### Security animation\n\n\nAnother way to prevent screenshot abuse is by displaying the barcode security animation, which\nsupports human-verification of a pass.\n\n\nThe physical manifestation of a security animation is a shimmering outline around the barcode of\nthe pass. This shimmering animation triggers only when the device is in motion so one can test\nthe pass' validity by tilting the device. On the other hand holding the device still will only\nanimate the colorful security animation in loop.\n\n\nTo enable security animation for a pass, in the pass class, set the [`SecurityAnimation`](/wallet/tickets/transit-passes/qr-code/rest/v1/SecurityAnimation)\nfield's [`AnimationType`](/wallet/tickets/transit-passes/qr-code/rest/v1/SecurityAnimation#AnimationType)\nto `FOIL_SHIMMER`.\n\n\nSee Figure 1. below for an example of how the security animation appears when it is enabled:\n\n\n**Figure 1.**\n\nProtect with Screen Lock\n------------------------\n\nTo protect your customer's access to their Pass, you can require a screen\nlock each time they add or access their pass. This can be done by setting `class.viewUnlockRequirement`.\nFor more details, see the\n[`ViewUnlockRequirement` type](/wallet/tickets/transit-passes/qr-code/rest/v1/ViewUnlockRequirement)."]]