Deciding whether to accept spaces in the card number field at mobile checkout
تحديد ما إذا كان ينبغي قبول المسافات في حقل رقم البطاقة عند الدفع عبر الهاتف المحمول
What the guidance says
Evergreen guidance on payment forms, checked today rather than announced as news, recommends that a card number field accept digits and spaces, because that is how the number is printed on the physical card. The same guidance asks that only numbers be allowed in the card number and security code fields, and that the security code accept three or four digits, since brands differ. For a merchant, the decision is narrow: keep the field digits-only and let the shopper remove spaces themselves, or accept both. Accepting spaces matches what the shopper is reading off the card. The suggested check is to type a test card number into your own mobile checkout with spaces exactly as printed, then again without spaces, and see whether both are accepted.
A concrete example
Consider a shopper buying a ceramic mug and a cotton tote bag in one order on a phone. The mug and the tote are ordinary products, and the only thing that differs between them at checkout is the total, not the card entry. The shopper copies the number from the physical card, spaces included, and the field either takes it or rejects it. If your checkout is digits-only, the shopper has to notice the error and retype. The decision you are making is whether that retyping is your policy or an accident of the field's validation rule. A check to try: place a test order for the mug alone, then for the mug and tote together, entering the number both ways each time.
Checks a merchant can try
Evergreen payment form guidance, again a reference rather than a fresh announcement, says to test the payment form with every card type you support and to make sure validation rules consider every possible format. That is the practical basis for your decision. Checks a merchant can try: run one test card from each brand you accept through the mobile checkout, typing the number with spaces and without; try a security code of each accepted length; and check the on-screen keyboard that appears, since a numeric keypad is recommended for these fields. Also try the same entries using only the keyboard and with a screen reader, as the guidance suggests. Record which combinations your field accepts.
Sources
ما تقوله الإرشادات
توصي إرشادات دائمة الصلاحية بشأن نماذج الدفع، التي جرى التحقق منها اليوم بدلًا من الإعلان عنها كخبر، بأن يقبل حقل رقم البطاقة الأرقام والمسافات، لأن الرقم يُطبع على البطاقة الفعلية بهذه الطريقة. وتطلب الإرشادات نفسها ألا يُسمح إلا بالأرقام في حقلَي رقم البطاقة ورمز الأمان، وأن يقبل رمز الأمان ثلاثة أو أربعة أرقام، لأن العلامات التجارية تختلف. وبالنسبة إلى التاجر، يكون القرار محدودًا: إما إبقاء الحقل مقتصرًا على الأرقام وترك المتسوق يزيل المسافات بنفسه، أو قبول كليهما. وقبول المسافات يتوافق مع ما يقرأه المتسوق من البطاقة. والفحص المقترح هو كتابة رقم بطاقة تجريبية في صفحة الدفع عبر هاتفك المحمول مع المسافات كما هي مطبوعة تمامًا، ثم مرة أخرى دون مسافات، ومعرفة ما إذا كان كلاهما مقبولًا.
مثال ملموس
تخيل متسوقًا يشتري كوبًا خزفيًا وحقيبة قطنية في طلب واحد عبر الهاتف. الكوب والحقيبة منتجان عاديان، والشيء الوحيد الذي يختلف بينهما عند إتمام الشراء هو الإجمالي، وليس إدخال البطاقة. ينسخ المتسوق الرقم من البطاقة الفعلية، بما في ذلك المسافات، ثم إما يقبله الحقل أو يرفضه. إذا كان إتمام الشراء لديك يقبل الأرقام فقط، فعلى المتسوق أن يلاحظ الخطأ ويعيد الكتابة. القرار الذي تتخذه هو ما إذا كانت إعادة الكتابة تلك سياسة لديك أم نتيجة عرضية لقاعدة التحقق في الحقل. فحص يمكنك تجربته: أنشئ طلبًا تجريبيًا للكوب وحده، ثم للكوب والحقيبة معًا، مع إدخال الرقم بالطريقتين في كل مرة.
فحوص يمكن للتاجر تجربتها
تقول إرشادات نموذج الدفع الدائمة، وهي مرة أخرى مرجع وليس إعلانًا جديدًا، إنه ينبغي اختبار نموذج الدفع مع كل نوع بطاقة تدعمه، والتأكد من أن قواعد التحقق تراعي كل صيغة ممكنة. وهذا هو الأساس العملي لقرارك. فحوص يمكن للتاجر تجربتها: مرّر بطاقة اختبار واحدة من كل علامة تجارية تقبلها عبر إتمام الشراء على الهاتف المحمول، بكتابة الرقم مع مسافات وبدونها؛ وجرّب رمز أمان من كل طول مقبول؛ وافحص لوحة المفاتيح التي تظهر على الشاشة، لأن لوحة مفاتيح رقمية يُوصى بها لهذه الحقول. وجرّب أيضًا المدخلات نفسها باستخدام لوحة المفاتيح فقط ومع قارئ شاشة، كما تقترح الإرشادات. وسجّل أي تركيبات يقبلها الحقل لديك.
المصادر
Ready to Build Your Online Store?
Join thousands of businesses on BuiBuy. Create your store in minutes — no coding required.
Start for Free