Closed daisyramos317 closed 8 years ago
Hey there @daisyramos317, Sorry for the slow reply on our end. That syntax isn't correct - you'll actually need to check the validation state returned by those functions. I'd recommend you do something like:
let cardParams = STPCardParams()
cardParams.number = ...
cardParams.expMonth = ...
cardParams.expYear = ...
cardParams.cvc = ...
if STPCardValidator.validationStateForCard(cardParams) == .Valid {
// the card is valid.
}
thank you! @jflinter
thanks
thanks
ممكن صديق تدفع علي
Abdulaziz Mohammed alghwly
Yemen Sana'a
لذلك كنت أستخدم إصدارًا قديمًا من Stripe ، v5.1.4 حتى وقت قريب ، ومن هنا جاءت تحذيرات الإهمال العديدة التي تلقيتها :) على أي حال ، فأنا أستخدم STPCardValidator وأردت معرفة ما إذا كان بناء الجملة الخاص بي صحيحًا عند استدعاء طرق .validationState ().
هذا ما لدي. ملاحظة: أنا أستخدم دالة regex للتحقق من نوع البطاقة
if (self.validateCardType(creditCardField.text!) == "Visa") { STPCardValidator.validationStateForCVC(self.securityField.text!, cardBrand: STPCardBrand.Visa) STPCardValidator.validationStateForNumber(self.creditCardField.text!, validatingCardBrand: true) }
So I was using an older version of Stripe, v5.1.4 until recently hence the numerous deprecation warnings I've received :) Anyhow I am using STPCardValidator and wanted to know if my syntax is correct when calling the .validationState() methods.
Here is what I have. Note: I am using a regex function to validate the card type
if (self.validateCardType(creditCardField.text!) == "Visa") { STPCardValidator.validationStateForCVC(self.securityField.text!, cardBrand: STPCardBrand.Visa) STPCardValidator.validationStateForNumber(self.creditCardField.text!, validatingCardBrand: true) }