@Test public void testReqOfflinePayAsyncParamInvalid() throws Exception { Object[][] test = new Object[][] { new Object[]{null, null, null, null, null}, new Object[]{BCReqParams.BCChannelTypes.ALI_APP, null, null, null, null}, new Object[]{BCReqParams.BCChannelTypes.ALI_SCAN, null, null, null, null}, new Object[]{BCReqParams.BCChannelTypes.ALI_SCAN, "试一个很长的title--参数公共返回参数取值及含义参见支付公共返回参数部分", null, null, null}, new Object[]{BCReqParams.BCChannelTypes.ALI_SCAN, "正常title", null, null, null}, new Object[]{BCReqParams.BCChannelTypes.ALI_SCAN, "正常title", -1, null, null}, new Object[]{BCReqParams.BCChannelTypes.ALI_SCAN, "正常title", 3, null, null}, new Object[]{BCReqParams.BCChannelTypes.WX_SCAN, "正常title", 3, "123", null}, new Object[]{BCReqParams.BCChannelTypes.WX_SCAN, "正常title", 3, "123456789ABCDE", null}, }; for (Object[] objects : test) { final CountDownLatch localLatch = new CountDownLatch(1); pay.reqOfflinePayAsync((BCReqParams.BCChannelTypes) objects[0], (String) objects[1], (Integer) objects[2], (String) objects[3], null, (String) objects[4], "terminalid", null, new BCCallback() { @Override public void done(BCResult result) { Assert.assertTrue(result instanceof BCPayResult); BCPayResult payResult = (BCPayResult) result; Assert.assertEquals(BCPayResult.RESULT_FAIL, payResult.getResult()); Assert.assertEquals((Integer)BCPayResult.APP_INTERNAL_PARAMS_ERR_CODE, payResult.getErrCode()); Assert.assertEquals(BCPayResult.FAIL_INVALID_PARAMS, payResult.getErrMsg()); localLatch.countDown(); } }); localLatch.await(2000, TimeUnit.MILLISECONDS); } }
public void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType, final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final String authCode, final String terminalId, final String storeId, final BCCallback callback) { reqOfflinePayAsync(channelType, billTitle, billTotalFee, billNum, null, null, null, optional, null, authCode, terminalId, storeId, callback); }
BCOfflinePay { public void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType, final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final String authCode, final String terminalId, final String storeId, final BCCallback callback) { reqOfflinePayAsync(channelType, billTitle, billTotalFee, billNum, null, null, null, optional, null, authCode, terminalId, storeId, callback); } }
BCOfflinePay { public void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType, final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final String authCode, final String terminalId, final String storeId, final BCCallback callback) { reqOfflinePayAsync(channelType, billTitle, billTotalFee, billNum, null, null, null, optional, null, authCode, terminalId, storeId, callback); } private  BCOfflinePay(); }
BCOfflinePay { public void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType, final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final String authCode, final String terminalId, final String storeId, final BCCallback callback) { reqOfflinePayAsync(channelType, billTitle, billTotalFee, billNum, null, null, null, optional, null, authCode, terminalId, storeId, callback); } private  BCOfflinePay(); synchronized static BCOfflinePay getInstance(); static Bitmap generateBitmap(String contentsToEncode,
                                        int imageWidth, int imageHeight,
                                        int marginSize, int color, int colorBack); void reqQRCodeAsync(final BCReqParams.BCChannelTypes channelType,
                               final String billTitle, final Integer billTotalFee,
                               final String billNum, final Map<String, String> optional,
                               final Boolean genQRCode, final Integer qrCodeWidth,
                               final BCCallback callback); void reqQRCodeAsync(final PayParams payParam,
                               final BCCallback callback); void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType,
                                   final String billTitle, final Integer billTotalFee,
                                   final String billNum, final Map<String, String> optional,
                                   final String authCode, final String terminalId,
                                   final String storeId, final BCCallback callback); void reqOfflinePayAsync(final PayParams payParam, final BCCallback callback); void reqWXNativeQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                       final String billNum, final Map<String, String> optional,
                                       final Boolean genQRCode, final Integer qrCodeWidth,
                                       final BCCallback callback); void reqAliOfflineQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                         final String billNum, final Map<String, String> optional,
                                         final Boolean genQRCode, final Integer qrCodeWidth,
                                         final BCCallback callback); void reqRevertBillAsync(final BCReqParams.BCChannelTypes channelType,
                                   final String billNum,
                                   final BCCallback callback); }
BCOfflinePay { public void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType, final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final String authCode, final String terminalId, final String storeId, final BCCallback callback) { reqOfflinePayAsync(channelType, billTitle, billTotalFee, billNum, null, null, null, optional, null, authCode, terminalId, storeId, callback); } private  BCOfflinePay(); synchronized static BCOfflinePay getInstance(); static Bitmap generateBitmap(String contentsToEncode,
                                        int imageWidth, int imageHeight,
                                        int marginSize, int color, int colorBack); void reqQRCodeAsync(final BCReqParams.BCChannelTypes channelType,
                               final String billTitle, final Integer billTotalFee,
                               final String billNum, final Map<String, String> optional,
                               final Boolean genQRCode, final Integer qrCodeWidth,
                               final BCCallback callback); void reqQRCodeAsync(final PayParams payParam,
                               final BCCallback callback); void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType,
                                   final String billTitle, final Integer billTotalFee,
                                   final String billNum, final Map<String, String> optional,
                                   final String authCode, final String terminalId,
                                   final String storeId, final BCCallback callback); void reqOfflinePayAsync(final PayParams payParam, final BCCallback callback); void reqWXNativeQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                       final String billNum, final Map<String, String> optional,
                                       final Boolean genQRCode, final Integer qrCodeWidth,
                                       final BCCallback callback); void reqAliOfflineQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                         final String billNum, final Map<String, String> optional,
                                         final Boolean genQRCode, final Integer qrCodeWidth,
                                         final BCCallback callback); void reqRevertBillAsync(final BCReqParams.BCChannelTypes channelType,
                                   final String billNum,
                                   final BCCallback callback);  }