使用Card.io编号Android修改Braintree cardForm

时间:2015-08-14 20:49:16

标签: android braintree card.io

我使用cardForm类(BrainTree SDK),我想在cardFormView中扫描成功但是成员变量是私有的(mcardNumber)时注入card.io结果。

源代码以字节码

编译

你有解决方案吗?感谢前进。

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == MY_SCAN_REQUEST_CODE) {
        String resultDisplayStr;
        if (data != null && data.hasExtra(CardIOActivity.EXTRA_SCAN_RESULT)) {
            CreditCard scanResult = data.getParcelableExtra(CardIOActivity.EXTRA_SCAN_RESULT);

            // Never log a raw card number. Avoid displaying it, but if necessary use getFormattedCardNumber()
            resultDisplayStr = "Card Number: " + scanResult.getRedactedCardNumber() + "\n";

            mCardForm.mCardNumber.setText(scanResult.getRedactedCardNumber()); // Access Error

            if (scanResult.isExpiryValid()) {
                resultDisplayStr += "Expiration Date: " + scanResult.expiryMonth + "/" + scanResult.expiryYear + "\n";
            }
            Log.e("OK","---> " + resultDisplayStr);
        }
        else {
            resultDisplayStr = "Scan was canceled.";
        }
    }
}

0 个答案:

没有答案