-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve payment by stripe #1084
fix: improve payment by stripe #1084
Conversation
1)corrected the keyboard type for input 2)made the whole button clickable in case of the month, year and card type selector 3)added card No. validator and automatic card type selector feat: fossasia#1071
val visaPattern = Pattern.compile("^4[0-9]{0,15}$") | ||
val masterCardPattern = Pattern.compile("^(5[1-5]|222[1-9]|22[3-9][0-9]|2[3-6]" + | ||
"[0-9]{2}|27[01][0-9]|2720)[0-9]{0,15}$") | ||
val americanExpressPattern = Pattern.compile("^3[47][0-9]{0,15}$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stripe most probably has pre defined functions to check the above. Can you confirm? if yes use them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have their own cardInputwidget which handles all these operation https://stripe.com/docs/mobile/android .
- That would mean changing the whole input section .. should I use it ???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that is the case then it is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate is current commit fine or I should use cardInputWidget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikit19 please reply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is fine
Please add wip: in title until the work is complete |
Lifted ticketIdAndQty from view layer to viewModel and done required changes feat: fossasia#1097
@iamareebjamal, please review and merge it |
Fix conflicts |
94aa3ce
to
089ef8f
Compare
635fcdd
to
94cc3c0
Compare
@iamareebjamal done |
cardBrand = attendeeViewModel.cardType[0] | ||
selectCardText.text = cardBrand | ||
rootView.cardSelector.isVisible = true | ||
rootView.cardNumber.error = "Invalid card number" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move logic to a util and remove duplication
app/src/main/java/org/fossasia/openevent/general/attendees/AttendeeFragment.kt
Show resolved
Hide resolved
@@ -131,4 +132,17 @@ object Utils { | |||
navigation.animation = AnimationUtils.loadAnimation(context, R.anim.slide_down) | |||
} | |||
} | |||
|
|||
fun creditCardVerify(s: String): Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name properly and return enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all unnecessary changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all unnecessary changes
1)corrected the keyboard type for input 2)made the whole button clickable in case of the month, year and card type selector 3)added card No. validator and automatic card type selector feat: fossasia#1071
71fe3b0
to
082b43f
Compare
@pranavpandey1998official Updates? |
@iamareebjamal I have introduced an enum as you said and removed all unnecessary changes. what next? |
Go to File changes and see the requested changes |
c19815b
to
14228f8
Compare
There are still unrelated changes. Please revert them. |
@iamareebjamal the indentation changes are done through gradlew spotlessApply , if i revert them gradlew spotlessCheck is failing and rest are changes are related to commit please specify if you find something else |
1)corrected the keyboard type for input
2)made the whole button clickable in case of the month, year and card type selector
3)added card No. validator and automatic card type selector
feat: #1071