Skip to content

Instantly share code, notes, and snippets.

@manojbhadane
Created January 2, 2019 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manojbhadane/742bfb4cccd5e94702a4ced47bfc17c1 to your computer and use it in GitHub Desktop.
Save manojbhadane/742bfb4cccd5e94702a4ced47bfc17c1 to your computer and use it in GitHub Desktop.
// Init
PaymentCardView paymentCard = (PaymentCardView) findViewById(R.id.creditCard);
// Options
paymentCard.setCardTitle("Pay Now"); // set from xml as well
paymentCard.setSubmitButtonText("Done"); // set from xml as well
// Callbacks
paymentCard.setOnPaymentCardEventListener(new PaymentCardView.OnPaymentCardEventListener() {
@Override
public void onCardDetailsSubmit(String month, String year, String cardNumber, String cvv) {
}
@Override
public void onError(String error) {
Toast.makeText(SampleActivity.this, error, Toast.LENGTH_SHORT).show();
}
@Override
public void onCancelClick() {
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment