Skip to content

Commit

Permalink
Fixed Issue #38 : Add set and get Cvv function (#40)
Browse files Browse the repository at this point in the history
* Corrected a typo in the comment

DESCRIPTION : Changed the comment which was incorrect

* Fixed Issue #38 Add set and get Cvv function

DESCRIPTION : Added getter and setter to allow user to get and set CVV programmatically
  • Loading branch information
Sanjeev yadav authored and vinaygaba committed Nov 3, 2018
1 parent 9c43418 commit 3f11033
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private void initDefaults() {
// Set the appropriate text color to the validTill TextView
mValidTill.setTextColor(mValidTillTextColor);

// If CVV is not null, set it to the expiryDate TextView
// If CVV is not null, set it to the cvv EditText
if (!TextUtils.isEmpty(mCvv)) {
mCvvView.setText(mCvv);
}
Expand Down Expand Up @@ -560,6 +560,18 @@ public void setCardNumber(String cardNumber) {
redrawViews();
}

public String getCvv() {
return mCvv;
}

public void setCvv(String mCvv) {
// If CVV is not null and it is editable, set it to the cvv EditText
if (!TextUtils.isEmpty(mCvv) && mIsCvvEditable) {
this.mCvv = mCvv;
mCvvView.setText(mCvv);
}
}

public String getCardName() {
return mCardName;
}
Expand Down

0 comments on commit 3f11033

Please sign in to comment.