我目前正在 android 平台上集成 Authorize.net SDK。我能够使用测试帐户成功发送我的交易。但是,我想在处理交易时跳过“登录/密码”屏幕。请注意,我目前使用的不是“API 登录 ID 和交易密钥”,而是我的测试帐户的登录名和密码。所以真正的问题是:
在代码中放置 API 登录 ID 和交易密钥的位置。
authNetObj = AuthNet
.getInstance(Environment.PRODUCTION,
R.layout.authnet_mobile_merchant_auth_dialog,
R.id.authnet_loginid_edit, R.id.authnet_password_edit,
R.id.authnet_auth_cancel_button,
R.id.authnet_auth_login_button);
Run Code Online (Sandbox Code Playgroud)
//没有API登录ID和交易密钥参数?
Intent authNetIntent = authNetObj.createAIMAuthCaptureIntent(this,
refId, totalAmount, creditCard, order, customer, shippingAddress,
shippingCharges, emailReceipt, merchantDefinedFields);
Run Code Online (Sandbox Code Playgroud)
谢谢
我的代码是:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="53dp"
android:layout_marginTop="34dp"
android:inputType="textNoSuggestions|text"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
JAVA Code I使用.
editText = (EditText) findViewById(R.id.editText);
editText.setInputType(InputType.TYPE_MASK_CLASS|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
Run Code Online (Sandbox Code Playgroud)
我在EditText中使用android:inputType ="textNoSuggestions | text",它禁用了所有设备的预测文本,但在三星Tab 2中它不起作用.我也通过Android代码申请,但似乎它打开给三星标签2中禁用此预测文本框的任何其他建议.

其他设备预览它没有显示预测文本框.

三星Tab 2预览它显示预测文本框.