@Test public void testReqUnionPaymentAsync() throws Exception { final BCHttpClientUtil.Response response = new BCHttpClientUtil.Response(); response.code = 200; response.content = "{\"result_msg\":\"OK\",\"err_detail\":\"\",\"result_code\":0,\"tn\":\"201511191446391024558\",\"id\":\"b1841106-639f-48d2-bfbe-5086b5dddc31\"}"; PowerMockito.stub(PowerMockito.method(BCHttpClientUtil.class, "httpPost", String.class, Map.class)).toReturn(response); pay.reqUnionPaymentAsync("正常title", 1, "123456789ABCDE", null, Mockito.mock(BCCallback.class)); Thread.sleep(1000); Mockito.verify(activity, Mockito.times(1)).startActivity(Mockito.any(Intent.class)); Assert.assertEquals("b1841106-639f-48d2-bfbe-5086b5dddc31", BCCache.getInstance().billID); }
public void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final BCCallback callback) { this.reqPaymentAsync(BCReqParams.BCChannelTypes.UN_APP, billTitle, billTotalFee, billNum, null, null, null, null, null, null, null, optional, null, callback); }
BCPay { public void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final BCCallback callback) { this.reqPaymentAsync(BCReqParams.BCChannelTypes.UN_APP, billTitle, billTotalFee, billNum, null, null, null, null, null, null, null, optional, null, callback); } }
BCPay { public void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final BCCallback callback) { this.reqPaymentAsync(BCReqParams.BCChannelTypes.UN_APP, billTitle, billTotalFee, billNum, null, null, null, null, null, null, null, optional, null, callback); } private  BCPay(); }
BCPay { public void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final BCCallback callback) { this.reqPaymentAsync(BCReqParams.BCChannelTypes.UN_APP, billTitle, billTotalFee, billNum, null, null, null, null, null, null, null, optional, null, callback); } private  BCPay(); synchronized static BCPay getInstance(Context context); static String initWechatPay(Context context, String wechatAppID); static void clear(); static void detachWechat(); static void detachBaiduPay(); static boolean isWXPaySupported(); static boolean isWXAppInstalledAndSupported(); void reqPaymentAsync(final PayParams payParam, final BCCallback callback); void reqWXPaymentAsync(final String billTitle, final Integer billTotalFee,
                                  final String billNum,
                                  final Map<String, String> optional, final BCCallback callback); void reqAliPaymentAsync(final String billTitle, final Integer billTotalFee,
                                   final String billNum,
                                   final Map<String, String> optional,
                                   final BCCallback callback); void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee,
                                     final String billNum,
                                     final Map<String, String> optional,
                                     final BCCallback callback); void reqBaiduPaymentAsync(final String billTitle, final Integer billTotalFee,
                                     final String billNum,
                                     final Map<String, String> optional,
                                     final BCCallback callback); @Deprecated void reqAliInlineQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                        final String billNum, final Map<String, String> optional,
                                        final String returnUrl,
                                        final String qrPayMode,
                                        final BCCallback callback); void reqBCNativeAsync(final String billTitle, final Integer billTotalFee,
                                 final String billNum, final Map<String, String> optional,
                                 final Boolean genQRCode, final Integer qrCodeWidth,
                                 final BCCallback callback); void prefund(final RefundParams params, final BCCallback callback); void sendSmsCode(final String phone, final BCCallback callback); void subscribe(final BCSubscription params, final String smsId, final String smsCode,
                          final String couponCode, final BCCallback callback); void cancelSubscription(final String sid, final BCCallback callback); }
BCPay { public void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final BCCallback callback) { this.reqPaymentAsync(BCReqParams.BCChannelTypes.UN_APP, billTitle, billTotalFee, billNum, null, null, null, null, null, null, null, optional, null, callback); } private  BCPay(); synchronized static BCPay getInstance(Context context); static String initWechatPay(Context context, String wechatAppID); static void clear(); static void detachWechat(); static void detachBaiduPay(); static boolean isWXPaySupported(); static boolean isWXAppInstalledAndSupported(); void reqPaymentAsync(final PayParams payParam, final BCCallback callback); void reqWXPaymentAsync(final String billTitle, final Integer billTotalFee,
                                  final String billNum,
                                  final Map<String, String> optional, final BCCallback callback); void reqAliPaymentAsync(final String billTitle, final Integer billTotalFee,
                                   final String billNum,
                                   final Map<String, String> optional,
                                   final BCCallback callback); void reqUnionPaymentAsync(final String billTitle, final Integer billTotalFee,
                                     final String billNum,
                                     final Map<String, String> optional,
                                     final BCCallback callback); void reqBaiduPaymentAsync(final String billTitle, final Integer billTotalFee,
                                     final String billNum,
                                     final Map<String, String> optional,
                                     final BCCallback callback); @Deprecated void reqAliInlineQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                        final String billNum, final Map<String, String> optional,
                                        final String returnUrl,
                                        final String qrPayMode,
                                        final BCCallback callback); void reqBCNativeAsync(final String billTitle, final Integer billTotalFee,
                                 final String billNum, final Map<String, String> optional,
                                 final Boolean genQRCode, final Integer qrCodeWidth,
                                 final BCCallback callback); void prefund(final RefundParams params, final BCCallback callback); void sendSmsCode(final String phone, final BCCallback callback); void subscribe(final BCSubscription params, final String smsId, final String smsCode,
                          final String couponCode, final BCCallback callback); void cancelSubscription(final String sid, final BCCallback callback);  }