Commit a32c84d7 authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents 41ed868c 9d1c7413
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>
\ No newline at end of file
......@@ -5,7 +5,9 @@
<w>alipay</w>
<w>amountexceed</w>
<w>appid</w>
<w>baifubao</w>
<w>baozheng</w>
<w>bestpay</w>
<w>caocao</w>
<w>chengyaojin</w>
<w>diaochan</w>
......@@ -18,6 +20,7 @@
<w>instrans</w>
<w>invalidmerno</w>
<w>invalidstore</w>
<w>jdpay</w>
<w>jsonpay</w>
<w>jspay</w>
<w>kongming</w>
......@@ -33,7 +36,9 @@
<w>noti</w>
<w>parametererror</w>
<w>patt</w>
<w>paxpay</w>
<w>posppp</w>
<w>qqpay</w>
<w>qrpay</w>
<w>shixiu</w>
<w>shopppp</w>
......@@ -43,6 +48,7 @@
<w>strs</w>
<w>sunquan</w>
<w>transclose</w>
<w>ucodepay</w>
<w>unionpay</w>
<w>unipay</w>
<w>unkonw</w>
......
......@@ -9,6 +9,7 @@
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/neptune" />
<option value="$PROJECT_DIR$/pay" />
</set>
</option>
......
......@@ -4,6 +4,7 @@
<modules>
<module fileurl="file://$PROJECT_DIR$/TangKuPos.iml" filepath="$PROJECT_DIR$/TangKuPos.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/neptune/neptune.iml" filepath="$PROJECT_DIR$/neptune/neptune.iml" />
<module fileurl="file://$PROJECT_DIR$/pay/pay.iml" filepath="$PROJECT_DIR$/pay/pay.iml" />
</modules>
</component>
......
......@@ -87,4 +87,5 @@ dependencies {
implementation 'com.google.zxing:core:3.3.2'
implementation(name: 'zx_print_library-debug', ext: 'aar')
implementation project(':pay')
implementation project(':neptune')
}
......@@ -135,7 +135,7 @@ public class App extends Application {
private void getPermissionYes(List<String> grantedPermissions) {
// 初始化日志保存文件夹
if (!INI.init("TangKu")) {
ToastUtils.showLong("日志文件夹初始化失败");
ToastUtils.showLong(R.string.log_file_err);
}
}
......@@ -146,7 +146,7 @@ public class App extends Application {
*/
@PermissionNo(100)
private void getPermissioNo(List<String> grantedPermissions) {
ToastUtils.showLong("权限申请失败");
ToastUtils.showLong(R.string.app_permission_to_fail);
}
......
......@@ -64,12 +64,12 @@ public class C {
* <p>
* sn:test2019 设备型号 AECRC10 (收银机)
*/
private static final String URL_TEST = "http://121.40.56.52:80/";
public static final String URL_TEST = "http://121.40.56.52:80/";
/**
* 开发平台(开发人员使用)
*/
private static final String URL_DEMO = "http://demo.51zzd.cn/";
public static final String URL_DEMO = "http://demo.51zzd.cn/";
/**
* 生产平台
......@@ -79,7 +79,7 @@ public class C {
/**
* 地址
*/
public static final String BASE_URL = URL_DEMO;
public static final String BASE_URL = URL_TEST;
private static final String PKG = "/tk/";
......@@ -646,8 +646,9 @@ public class C {
public static final String SUCC = "0000";
}
public final class SYSTEM {
public static final class SYSTEM {
public static final String DIALOGISDISMISS = "DIALOGISDISMISS";
public static boolean mStateEnable = false;
}
public final class TRULE_STATUS {
......@@ -660,4 +661,49 @@ public class C {
public static final int USED = 2;
public static final int INVALID = 3;
}
/**
* 支付系统
*/
public final class PAY_SYSTEM {
/**
* 当前支付系统
*/
public static final int CURRENT = PAX.APP;
/**
* 浙星
*/
public static final int ZX = 100101;
/**
* 拉卡拉
*/
public static final int LKL = 100201;
/**
* 百富
*/
public final class PAX {
/**
* 统一支付APP
*/
public static final int APP = 100301;
/**
* 接口
*/
public static final int API = 100302;
}
/**
* 交易类型
*/
public final class Trans_Type {
public static final int Trans_Type_Return = 0;
public static final int Trans_Type_Recharge = 1;
}
}
}
......@@ -4,6 +4,7 @@ import android.content.Context;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatDelegate;
import android.view.KeyEvent;
......@@ -63,10 +64,12 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
if (!(this instanceof BaseView)) {
throw new RuntimeException(getClass().getSimpleName() + "需要实现继承自BaseView的行为接口");
}
if (!(this.getClass().getGenericSuperclass() instanceof ParameterizedType && ((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments().length > 0)) {
if (!(this.getClass().getGenericSuperclass() instanceof ParameterizedType && ((ParameterizedType) (this.getClass()
.getGenericSuperclass())).getActualTypeArguments().length > 0)) {
throw new RuntimeException(getClass().getSimpleName() + "在继承时,需要注明泛型类");
}
Class mPresenterClass = (Class) ((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments()[0];
Class mPresenterClass = (Class) ((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments()
[0];
mPresenter = InstanceUtil.getInstance(mPresenterClass);
mPresenter.setIntent(getIntent()).setView(this).build();
}
......@@ -76,6 +79,8 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
super.onDestroy();
RxBus.get().unregister(mContext);
if (mPresenter != null) mPresenter.onDetached();
// 注销服务
// com.xingdata.pay.neptune.ipc.Factory.unBindService(this);
}
public abstract void initView();
......@@ -121,14 +126,33 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
}
}
@Override
protected void onStart() {
C.SYSTEM.mStateEnable = true;
super.onStart();
}
@Override
protected void onResume() {
C.SYSTEM.mStateEnable = true;
if (SPUtils.getInstance().getBoolean(C.SYSTEM.DIALOGISDISMISS)) {
mLoadingDialog.dismiss();
}
super.onResume();
}
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
C.SYSTEM.mStateEnable = false;
super.onSaveInstanceState(outState, outPersistentState);
}
@Override
protected void onStop() {
C.SYSTEM.mStateEnable = false;
super.onStop();
}
@Override
public void pop() {
if (getSupportFragmentManager().getFragments().size() > 1) {
......
......@@ -233,7 +233,7 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
* @param mRecLen 自动关闭的时间
*/
public void show(BaseActivity activity, int mRecLen) {
if (AppUtils.isAppForeground()) {
if (AppUtils.isAppForeground() && C.SYSTEM.mStateEnable) {
if (!isShowing) {
this.recLen = mRecLen;
this.shutDown = true;
......@@ -283,7 +283,7 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
* 关闭
*/
public void dismiss() {
if (AppUtils.isAppForeground()) {
if (AppUtils.isAppForeground() && C.SYSTEM.mStateEnable) {
if (isShowing) {
isShowing = false;
if (getBaseActivity() != null && getBaseActivity().mDialogs != null) {
......@@ -351,4 +351,5 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
mBaseBinding.btnConfirm.setText(OK);
return this;
}
}
\ No newline at end of file
......@@ -41,8 +41,7 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin
}
@Override
public void updateUserSus(Oper oper)
{
public void updateUserSus(Oper oper) {
ToastUtils.showShort("修改成功");
mPresenter.userListFragment.updateUserSus(oper);
}
......@@ -58,6 +57,11 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin
mPresenter.userListSearchFragment.searchOperSus(operPager);
}
@Override
public void searchError() {
mPresenter.userListFragment.searchError();
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
Global.clickHideKeyboard(ev, this);
......
......@@ -26,6 +26,7 @@ public interface UserContract {
void updateUserSus(Oper oper);
void delUserSus();
void searchOperSus(Pager<Oper> operPager);
void searchError();
}
abstract class Presenter extends BasePresenter<View> {
......
......@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.manage.user;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserInfoEditFragment;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserInfoFragment;
......@@ -52,9 +53,9 @@ public class UserPresenter extends UserContract.Presenter {
public void getUserList(String wd) {
ApiFactory.Oper.queryOper(wd).subscribe(operPager -> {
if (wd==null){
if (wd == null) {
mView.queryOperSus(operPager);
}else {
} else {
mView.searchOperSus(operPager);
}
}, throwable -> {
......@@ -108,12 +109,38 @@ public class UserPresenter extends UserContract.Presenter {
// }
// public List<String> getOperLevelList() {
// ArrayList<String> operLevelList = new ArrayList<>();
// Iterator<Map.Entry<String, String>> iterator = operLevel.entrySet().iterator();
// while (iterator.hasNext()) {
// operLevelList.add(iterator.next().getKey());
// }
// return operLevelList.subList(0, operLevelList.size() - 1);
// }
/**
* 获取下拉列表
* @return
*/
public List<String> getOperLevelList() {
ArrayList<String> operLevelList = new ArrayList<>();
Iterator<Map.Entry<String, String>> iterator = operLevel.entrySet().iterator();
while (iterator.hasNext()) {
operLevelList.add(iterator.next().getKey());
Map.Entry entity = iterator.next();
int inOperLevel = Integer.parseInt(entity.getValue().toString());
if (inOperLevel < LoginPresenter.loginReturnBean.getOperLevel()) {
operLevelList.add(entity.getKey().toString());
}
}
return operLevelList.subList(0, operLevelList.size() - 1);
return operLevelList;
}
/**
* 判断是否有权限编辑店员
* @param oper 编辑的店员级别
* @return
*/
public boolean isEdit(Oper oper) {
return oper!=null&&LoginPresenter.loginReturnBean.getOperLevel() > oper.getOperLevel() && LoginPresenter.loginReturnBean.getOperLevel() != 1;
}
}
......@@ -4,34 +4,18 @@ package com.xingdata.zzdpos.ui.manage.user.fragment;
* Created by JM_DEV on 2017/12/21.
*/
import android.app.DatePickerDialog;
import android.graphics.Color;
import android.view.View;
import android.widget.CheckBox;
import android.widget.DatePicker;
import android.widget.RadioButton;
import android.widget.TextView;
import com.bigkoo.pickerview.OptionsPickerView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentUserInfoEditBinding;
import com.xingdata.zzdpos.databinding.FragmentVipInfoEditBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.ui.vip.dialog.VipEditMenuDialog;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.util.Calendar;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -39,6 +23,7 @@ import java.util.List;
*/
public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUserInfoEditBinding> {
private Oper oper;
private List<String> strLevels;
public void setOper(Oper oper) {
this.oper = oper;
......@@ -78,7 +63,7 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
ToastUtils.showShort("店员帐号不能为空");
return;
}
if (mViewBinding.userPhone.getText().length() !=11) {
if (mViewBinding.userPhone.getText().length() != 11) {
ToastUtils.showShort("店员帐号长度必须11位");
return;
}
......@@ -91,7 +76,7 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
mOper.setOperLevel(Byte.valueOf(mPresenter.operLevel.get(mViewBinding.userLevel.getText().toString())));
mOper.setOperMobile(Long.parseLong(mViewBinding.userPhone.getText().toString()));
mOper.setOperName(mViewBinding.userName.getText().toString());
if (oper==null) {
if (oper == null) {
mPresenter.addUser(mOper);
} else {
mOper.setOperId(oper.getOperId());
......@@ -103,6 +88,12 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
strLevels = mPresenter.getOperLevelList();
if (strLevels.size()!=0){
mViewBinding.userLevel.setText(strLevels.get(strLevels.size()-1));
}
}
......@@ -116,7 +107,7 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
mViewBinding.userLevel.setText(mPresenter.getOperLevelList().get(options1));
mViewBinding.userLevel.setText(strLevels.get(options1));
}
}).setTitleText("请选择")
.setDividerColor(Color.BLACK)
......@@ -124,7 +115,7 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
.setContentTextSize(20)
.build();
pvOptions.setPicker(mPresenter.getOperLevelList());
pvOptions.setPicker(strLevels);
pvOptions.show();
}
......@@ -134,5 +125,4 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
return false;
}
}
......@@ -12,10 +12,8 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentUserInfoBinding;
import com.xingdata.zzdpos.databinding.FragmentUserInfoEditBinding;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog;
/**
* 会员信息界面
......@@ -41,7 +39,7 @@ public class UserInfoFragment extends BaseFragment<UserPresenter, FragmentUserIn
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.user_Level:
ShowPickerViewStoreAddress();
// ShowPickerViewStoreAddress();
break;
case R.id.onSure:
......@@ -62,33 +60,34 @@ public class UserInfoFragment extends BaseFragment<UserPresenter, FragmentUserIn
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
mViewBinding.infoTitle.popMenu.setVisibility(mPresenter.isEdit(oper) ? View.VISIBLE : View.GONE);
mViewBinding.infoTitle.popMenu.setOnClickListener(view -> {
mPresenter.userMenuDialog.setOper(oper);
mPresenter.userMenuDialog.setOper(oper);
mPresenter.userMenuDialog.show((BaseActivity) getActivity());
});
}
/**
* 弹出选择会员P
*/
private void ShowPickerViewStoreAddress() {// 弹出选择器
OptionsPickerView pvOptions = new OptionsPickerView.Builder(getActivity(), new
OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
mViewBinding.userLevel.setText(mPresenter.getOperLevelList().get(options1));
}
}).setTitleText("请选择")
.setDividerColor(Color.BLACK)
.setTextColorCenter(Color.BLACK) //设置选中项文字颜色
.setContentTextSize(20)
.build();
pvOptions.setPicker(mPresenter.getOperLevelList());
pvOptions.show();
}
//
// /**
// * 弹出选择会员P
// */
// private void ShowPickerViewStoreAddress() {// 弹出选择器
// OptionsPickerView pvOptions = new OptionsPickerView.Builder(getActivity(), new
// OptionsPickerView.OnOptionsSelectListener() {
// @Override
// public void onOptionsSelect(int options1, int options2, int options3, View v) {
// mViewBinding.userLevel.setText(mPresenter.getOperLevelList().get(options1));
// }
// }).setTitleText("请选择")
// .setDividerColor(Color.BLACK)
// .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
// .setContentTextSize(20)
// .build();
//
// pvOptions.setPicker(mPresenter.getOperLevelList());
// pvOptions.show();
// }
@Override
......
......@@ -115,4 +115,12 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
onRefresh();
}
public void searchError() {
adapter.setNewData(null);
adapter.setEnableLoadMore(false);
adapter.loadMoreComplete();
mViewBinding.userRefresh.setRefreshing(false);
}
}
......@@ -138,27 +138,41 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
mPasswordDialog.setSaleorder(saleorder).show(this);
break;
case C.PAY_CHANNEL.BANK:
// mPresenter.payInBank();
mPresenter.payInBank();
break;
case C.PAY_CHANNEL.ALI:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_ali);
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInAli(barcode);
});
mScanFragment.setOnBackPressedListener(this::backToSettleFragment);
this.start(mScanFragment);
switch (C.PAY_SYSTEM.CURRENT) {
case C.PAY_SYSTEM.PAX.API:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_ali);
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInAli(barcode);
});
mScanFragment.setOnBackPressedListener(this::backToSettleFragment);
this.start(mScanFragment);
break;
case C.PAY_SYSTEM.PAX.APP:
mPresenter.payInAli(null);
break;
}
break;
case C.PAY_CHANNEL.WECHAT:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_wechat);
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInWechat(barcode);
});
mScanFragment.setOnBackPressedListener(this::backToSettleFragment);
this.start(mScanFragment);
switch (C.PAY_SYSTEM.CURRENT) {
case C.PAY_SYSTEM.PAX.API:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_channel_wechat);
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInWechat(barcode);
});
mScanFragment.setOnBackPressedListener(this::backToSettleFragment);
this.start(mScanFragment);
break;
case C.PAY_SYSTEM.PAX.APP:
mPresenter.payInWechat(null);
break;
}
break;
}
}
......@@ -186,9 +200,9 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
}
@Override
public void showPayFailFragment(Throwable throwable, Saleorder saleorder) {
public void showPayFailFragment(String throwable, Saleorder saleorder) {
if (throwable != null) {
LogUtils.e(throwable.getMessage());
LogUtils.e(throwable);
}
this.start(mPayResultFragment.setResult(false).setSaleorder(saleorder));
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
......
......@@ -125,7 +125,7 @@ interface SettleContract {
* @param throwable 错误信息
* @param saleorder 订单信息
*/
void showPayFailFragment(Throwable throwable, Saleorder saleorder);
void showPayFailFragment(String throwable, Saleorder saleorder);
/**
* 显示支付中页面
......
......@@ -11,7 +11,6 @@ import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.model.Ussku;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.util.StringUtil;
import java.util.ArrayList;
......
......@@ -104,9 +104,9 @@ public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding>
@Override
public void rechangeSus(Vip v) {
ViewTools.toastSuss(this, "充值成功");
if ( mPresenter.vipSearchFragment!=null)pop();
if (mPresenter.vipSearchFragment != null) pop();
// if ( mPresenter.vipRechargeFragment!=null)pop();
popTo(mPresenter.vipListFragment.getClass(),false);
popTo(mPresenter.vipListFragment.getClass(), false);
mPresenter.vipListFragment.onRefresh();
}
......@@ -123,6 +123,11 @@ public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding>
}).show(this);
}
@Override
public void rechangListerror() {
mPresenter.vipRechargeListFragment.rechangListerror();
}
@Override
public void getVipLevelSus(Pager<Level> levelPager) {
......
......@@ -44,6 +44,7 @@ public interface VipContract {
void loadPays(List<Pay> pays);
void rechangeSus(Vip v);
void rechangeErr(Vip v, Long amtPay, Long amtSend,String mes);
void rechangListerror();
}
......
......@@ -124,6 +124,7 @@ public class VipPresenter extends VipContract.Presenter {
ApiFactory.Rctrace.queryRecharge(vipID, number, 10).subscribe(rechargeOrderPager -> {
mView.getRechargeOrderSus(rechargeOrderPager);
}, throwable -> {
mView.rechangListerror();
ToastUtils.showShort(throwable.getMessage());
});
......
......@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.vip.adapter;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.TypedValue;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
......@@ -27,6 +28,13 @@ public class VipListAdapter extends BaseAdapter<Vip, ItemVipListItemBinding> {
protected void convert(ItemVipListItemBinding mViewBinding, Vip item) {
mViewBinding.vipName.setText(item.getVipName());
mViewBinding.vipMobile.setText(String.valueOf(item.getVipMobile()));
mViewBinding.vipDiscount.setText(item.getVipDefDiscount()==100?"无折扣":ConvertUtil.discount(item.getVipDefDiscount())+"折");
if(item.getVipDefDiscount()==100){
mViewBinding.vipDiscount.setText("无折扣");
mViewBinding.vipDiscount. setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, mContext.getResources().getDimensionPixelOffset(R.dimen.all_text_size));
}else {
mViewBinding.vipDiscount.setText(ConvertUtil.discount(item.getVipDefDiscount())+"折");
mViewBinding.vipDiscount.setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, mContext.getResources().getDimensionPixelOffset(R.dimen.big_text_size));
}
}
}
......@@ -35,7 +35,7 @@ public class VipRechargeAdapter extends BaseAdapter<VipRechargeOrder, ItemVipExp
mViewBinding.expenseMoney.setText(ConvertUtil.fenToYuan2(item.getCardAmtPay()));
mViewBinding.expenseShop.setText(LoginPresenter.loginReturnBean.getShopNameAbcn());
//设置支付方式
// mViewBinding.expenseType.setText(item.getPayName());
// mViewBinding.expenseType.setText(item.getP);
// mViewBinding.imgLeft.setBackgroundResource(getPayName(item));
mViewBinding.expenseTime.setText(StringUtil.format(new Date(item.getCreateTime()),StringUtil.mmddhhmmmDatePattern));
}
......
......@@ -55,6 +55,7 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI
mViewBinding.infoTitle.popMenu.setVisibility(View.GONE);
if (vip != null) {
mViewBinding.infoTitle.tvTitle.setText("修改会员");
mViewBinding.vipPhone.setEnabled(false);
mViewBinding.vipDiscounts.setText(vip.getVipLevelName() + vip.getVipDefDiscount() + "折");
String strDate=String.valueOf(vip.getVipBirthday());
if (strDate.length()==8){
......@@ -79,6 +80,7 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI
}
} else {
mViewBinding.infoTitle.tvTitle.setText("添加会员");
mViewBinding.vipPhone.setEnabled(true);
mViewBinding.vipDiscounts.setEnabled(true);
mViewBinding.vipDiscounts.setText(mPresenter.levels.get(0).getVipLevelName() + " " + ConvertUtil.discount(mPresenter.levels.get(0).getVipDefDiscount()) + "折");
vipDiscounts = mPresenter.levels.get(0).getVipDefDiscount();
......
......@@ -107,4 +107,14 @@ public class VipRechargeListFragment extends BaseFragment<VipPresenter, Fragment
mViewBinding.rechargeRefresh.setRefreshing(false);
}
public void rechangListerror() {
vipRechargeAdapter.setNewData(null);
vipRechargeAdapter.setEnableLoadMore(false);
vipRechargeAdapter.loadMoreComplete();
mViewBinding.rechargeRefresh.setRefreshing(false);
}
}
......@@ -6,6 +6,7 @@ import android.content.res.Resources;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.DeviceUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.xingdata.zzdpos.C;
import java.lang.reflect.Method;
......@@ -28,8 +29,13 @@ public final class SystemUtil {
* @return 设备型号
*/
public static String getDeviceModel() {
// return DeviceUtils.getModel();
return "X990";
switch (C.URL.BASE_URL) {
case C.URL.URL_DEMO:
case C.URL.URL_TEST:
return "X990";
default:
return DeviceUtils.getModel();
}
}
......@@ -48,17 +54,23 @@ public final class SystemUtil {
* @return 设备SN号
*/
public static String getDeviceSN() {
if (deviceSN == null) {
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class);
deviceSN = (String) get.invoke(c, "ro.serialno");
} catch (Exception e) {
e.printStackTrace();
}
switch (C.URL.BASE_URL) {
case C.URL.URL_DEMO:
return "0818562";
case C.URL.URL_TEST:
return "test2018";
default:
if (deviceSN == null) {
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class);
deviceSN = (String) get.invoke(c, "ro.serialno");
} catch (Exception e) {
e.printStackTrace();
}
}
return deviceSN;
}
// return deviceSN;
return "test2018";
}
/**
......
......@@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/all_margin"
android:background="@mipmap/mk_grade01" />
android:background="@mipmap/iv_vip" />
<LinearLayout
android:layout_width="match_parent"
......
......@@ -103,9 +103,11 @@
android:orientation="horizontal">
<LinearLayout
android:layout_marginLeft="8dp"
android:id="@+id/stealLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginRight="10dp"
android:layout_weight="2"
android:background="@drawable/selector_paymoney_radiobutton_bg"
android:gravity="center_vertical"
......
......@@ -34,7 +34,7 @@
style="@style/default_blacktext_no_margin_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
android:text="现金" />
<TextView
android:id="@+id/expense_time"
......
......@@ -769,6 +769,8 @@
<!--升级页面-->
<string name="update_hint_done">已经是最新版本</string>
<string name="app_permission_to_fail">权限申请失败</string>
<string name="log_file_err">日志文件夹初始化失败</string>
</resources>
......@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.1'
classpath "io.realm:realm-gradle-plugin:4.0.0"
}
}
......
#Wed Dec 20 16:07:54 CST 2017
#Wed Apr 18 18:01:23 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.5'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.alibaba:fastjson:1.1.67.android'
implementation 'com.blankj:utilcode:1.11.1'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.xingdata.pay.neptune;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.xingdata.pay.neptune.test", appContext.getPackageName());
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xingdata.pay.neptune" />
package com.pax.pay.service.aidl;
interface PayService {
String doTrans(String jsonStr);
}
package com.xingdata.pay.neptune;
public class C {
/**
* 交易状态
*/
public final static class PAY_STATE {
/**
* 支付中 (默认状态)
*/
public final static int ING = 0;
/**
* 支付成功
*/
public final static int SUCCESS = 1;
/**
* 支付失败
*/
public final static int FAIL = 2;
/**
* 自定义的错误信息的标识
*/
public final static int FAIL_CUSTOM = -999;
}
/**
* 操作类型
*/
public final static class ACTION_TYPE {
/**
* 条码支付
*/
public final static int PAY_BARCODE = 101;
/**
* 二维码支付
*/
public final static int PAY_QR = 102;
/**
* 公众号支付
*/
public final static int PAY_WOA = 103;
/**
* 退货
*/
public final static int REFUND = 200;
/**
* 撤销
*/
public final static int VOID = 300;
/**
* 查询
*/
public final static int QUERY = 400;
}
/**
* 交易类型
*/
public final class PAY_CHANNEL {
public static final int CASH = 1;
public static final int WECHAT = 2;
public static final int ALI = 3;
public static final int BANK = 4;
public static final int CARD = 5;
public static final int TALLY = 9;
}
}
package com.xingdata.pay.neptune;
import android.content.Context;
import com.blankj.utilcode.util.LogUtils;
import com.xingdata.pay.neptune.ipc.Factory;
import io.reactivex.Observable;
public class NeptuneCenter {
private static class NeptuneCenterHolder {
private static final NeptuneCenter INSTANCE = new NeptuneCenter();
}
/**
* 交易基本信息
*/
public static NeptuneCenter getInstance() {
return NeptuneCenter.NeptuneCenterHolder.INSTANCE;
}
public NeptuneCenter init(Context context) {
LogUtils.e("初始化NeptuneCenter");
Factory.getInstance().init(context);
return this;
}
/**
* 支付
*
* @param orderNo 订单号
* @param payChannel 支付渠道
* @param orderAmt 金额
* @return 支付结果的Observable
*/
public Observable<Response> pay(String orderNo, int payChannel, Long orderAmt) {
return Factory.pay(orderNo, payChannel, orderAmt);
}
/**
* 退款
*
* @param payChannel 支付渠道
* @param orderAmt 金额
* @return 退款结果的Observable
*/
public Observable<Response> refund(String orderNo, int payChannel, Long orderAmt) {
return Factory.refund(orderNo, payChannel, orderAmt);
}
/**
* 交易状态
*
* @param orderAmt 原交易金额,为null则不参与查询
* @param origOrderNo 原订单号
* @param transUniqueId 原交易流水号, 为null则不参与查询
* @return 查询结果的Observable
*/
public Observable<Response> query(String orderNo, Long orderAmt, String origOrderNo, String transUniqueId) {
return Factory.query(orderNo, orderAmt, origOrderNo, transUniqueId);
}
}
package com.xingdata.pay.neptune;
public class Response {
public Response() {
}
public Response(int code, String msg) {
this.code = code;
this.msg = msg;
}
private int code;
private String msg;
private String body;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
}
package com.xingdata.pay.neptune;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import com.blankj.utilcode.util.StringUtils;
import java.math.BigDecimal;
import java.util.List;
class Util {
/**
* 分转元
*
* @param fen 分
* @return 元
*/
public static String fenToYuan(Long fen) {
if (fen == null || fen == 0) return "0.00";
BigDecimal decimal = new BigDecimal(fen);
return decimal.divide(new BigDecimal(100), 2, BigDecimal.ROUND_DOWN).toString();
}
/**
* 分转元
*
* @param fen 分
* @return 元
*/
public static String fenToYuanNoPoint(Long fen) {
if (fen == null) return "0";
return String.valueOf(fen / 100);
}
/**
* 折扣率转换
*
* @param dis 分
* @return 元
*/
public static String discount(int dis) {
String strFen = String.valueOf((double) dis / 10);
return noZero(strFen);
}
/**
* 分转元
*
* @param fen 分
* @param isMonetary 是否有货币单位
* @return 元
*/
public static String fenToYuan(Long fen, boolean isMonetary) {
return (isMonetary ? "¥" : "") + fenToYuan(fen);
}
/**
* 元转分
*
* @param yuan 元
* @return 分
*/
public static Long yuanToFen(String yuan) {
yuan = StringUtils.isEmpty(yuan) ? "0" : yuan;
BigDecimal b = new BigDecimal(Double.valueOf(yuan) * 100);
return b.setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
}
/**
* 字符串转数字
*
* @param str 字符串
* @return 数字
*/
public static Long stringToLong(String str) {
str = StringUtils.isEmpty(str) ? "0" : str;
return Long.valueOf(str);
}
/**
* 数字转字符串
*
* @param l 数字
* @return 字符串
*/
public static String longToString(Long l) {
if (l == null) return "0";
return String.valueOf(l);
}
/**
* 分转元去掉.0 ROUND_DOWN
*
* @param fen 分
* @return 元
*/
public static String fenToYuanNoZero(Long fen) {
String ss = fenToYuan2(fen);
return noZero(ss);
}
private static String noZero(String ss) {
if (ss.endsWith(".00")) {
ss = ss.replace(".00", "");
} else if (ss.endsWith(".0")) {
ss = ss.replace(".0", "");
} else if (ss.endsWith("0")) {
ss = ss.substring(0, ss.length() - 1);
}
return ss;
}
/**
* 分转元保留2位小數
*
* @param fen 分
* @return 元
*/
public static String fenToYuan2(Long fen) {
if (fen == null) {
return "0.00";
}
BigDecimal decimal = new BigDecimal(fen);
return decimal.divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN).toString();
}
/**
* 折扣率转换最大100
*
* @param dis 分
* @return 元
*/
public static String discount(Long dis) {
if (dis > 100) {
return "10";
}
BigDecimal decimal = new BigDecimal(dis);
return decimal.divide(new BigDecimal(10)).setScale(0, BigDecimal.ROUND_DOWN).toString();
}
/**
* 创建显式intent
*
* @param context context
* @param implicitIntent 隐式intent
* @return 显示intent
*/
public static Intent createExplicitFromImplicitIntent(Context context, Intent implicitIntent) {
PackageManager pm = context.getPackageManager();
List<ResolveInfo> resolveInfo = pm.queryIntentServices(implicitIntent, 0);
if (resolveInfo == null || resolveInfo.size() != 1) {
return null;
}
ResolveInfo serviceInfo = resolveInfo.get(0);
String packageName = serviceInfo.serviceInfo.packageName;
String className = serviceInfo.serviceInfo.name;
ComponentName component = new ComponentName(packageName, className);
Intent explicitIntent = new Intent(implicitIntent);
explicitIntent.setComponent(component);
return explicitIntent;
}
}
package com.xingdata.pay.neptune.ipc;
public class C {
static String APP_ID = "com.xingdata.zzdpos";
static String APP_NAME = "TangKuPos";
/**
* 重试次数
*/
static final int RETRY_COUNT = 6;
/**
* 重试延迟时间
*/
static final int RETRY_DELAY_TIME = 5 * 1000;
class CODE {
/**
* 成功
*/
final static String SUCC = "0";
/**
* 自定义的错误信息的标识
*/
final static String FAIL_CUSTOM = "999";
}
/**
* 支付方式
*/
class PAY_MODE {
/**
* 银联支付
*/
final static String UNIONPAY = "CHANPAY";
/**
* 微信支付
*/
final static String WECHAT = "WECHAT";
/**
* 支付宝
*/
final static String ALIPAY = "ALIPAY";
/**
* 百富支付
*/
final static String PAXPAY = "PAXPAY";
/**
* 百度钱包
*/
final static String BAIFUBAO = "BAIFUBAO";
/**
* 银联二维码
*/
final static String UCODEPAY = "UCODEPAY";
/**
* QQ钱包
*/
final static String QQPAY = "QQPAY";
/**
* 京东支付
*/
final static String JDPAY = "JDPAY";
/**
* 翼支付
*/
final static String BESTPAY = "BESTPAY";
}
/**
* 交易类型
*/
class TRANS_TYPE {
/**
* 消费
*/
final static String SALE = "SALE";
/**
* 撤销
*/
final static String VOID = "VOID";
/**
* 退货
*/
final static String REFUND = "REFUND";
/**
* 预授权
*/
final static String AUTH = "AUTH";
/**
* 预授权撤销
*/
final static String AUTH_VOID = "AUTH_VOID";
/**
* 预授权完成请求
*/
final static String AUTH_CM = "AUTH_CM";
/**
* 预授权完成请求撤销
*/
final static String AUTH_CM_VOID = "AUTH_CM_VOID";
/**
* 交易状态查询
*/
public static final String TRANS_STAUS_QUERY = "ONLINE_QUERY";
}
}
package com.xingdata.pay.neptune.ipc;
class IRequest {
private IRequest() {
}
public static IRequest create() {
IRequest iRequest = new IRequest();
iRequest.setAppName(C.APP_NAME);
iRequest.setAppId(C.APP_ID);
return iRequest;
}
/**
* 应用ID
*/
private String appId;
/**
* 应用名称
*/
private String appName;
/**
* 收银台应用名称
*/
private String transType;
/**
* 订单号
*/
private String orderNo;
/**
* 交易金额
*/
private String transAmount;
/**
* 支付方式
*/
private String payMode;
/**
* 原交易唯一标识
*/
private String transUniqueIDString;
/**
* 原收银台交易唯一标识
*/
private String origTransUniqueID;
private String orderInfo;
private String origOrderNo;
private String origOrderInfo;
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getTransType() {
return transType;
}
public void setTransType(String transType) {
this.transType = transType;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getTransAmount() {
return transAmount;
}
public void setTransAmount(String transAmount) {
this.transAmount = transAmount;
}
public String getPayMode() {
return payMode;
}
public void setPayMode(String payMode) {
this.payMode = payMode;
}
public String getTransUniqueIDString() {
return transUniqueIDString;
}
public void setTransUniqueIDString(String transUniqueIDString) {
this.transUniqueIDString = transUniqueIDString;
}
public String getOrderInfo() {
return orderInfo;
}
public void setOrderInfo(String orderInfo) {
this.orderInfo = orderInfo;
}
public String getOrigOrderNo() {
return origOrderNo;
}
public void setOrigOrderNo(String origOrderNo) {
this.origOrderNo = origOrderNo;
}
public String getOrigOrderInfo() {
return origOrderInfo;
}
public void setOrigOrderInfo(String origOrderInfo) {
this.origOrderInfo = origOrderInfo;
}
public String getOrigTransUniqueID() {
return origTransUniqueID;
}
public void setOrigTransUniqueID(String origTransUniqueID) {
this.origTransUniqueID = origTransUniqueID;
}
}
package com.xingdata.pay.neptune.ipc;
class IResponse {
/**
* 应用ID
*/
private String appId;
/**
* 交易类型
*/
private String transType;
/**
* 订单号
*/
private String orderNo;
/**
* 应答码
*/
private String rspCode;
/**
* 应答信息
*/
private String rspMsg;
public IResponse() {
}
public IResponse(String rspCode, String rspMsg) {
this.rspCode = "999";
this.rspMsg = rspMsg;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getTransType() {
return transType;
}
public void setTransType(String transType) {
this.transType = transType;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getRspCode() {
return rspCode;
}
public void setRspCode(String rspCode) {
this.rspCode = rspCode;
}
public String getRspMsg() {
return rspMsg;
}
public void setRspMsg(String rspMsg) {
this.rspMsg = rspMsg;
}
}
package com.xingdata.pay.neptune.ipc;
import com.xingdata.pay.neptune.Response;
import io.reactivex.functions.Function;
class ResultFilter implements Function<IResponse, Response> {
@Override
public Response apply(IResponse iResponse) throws Exception {
int code;
if (iResponse.getRspCode().equals("0")) {
code = 1;
} else {
code = Integer.parseInt(iResponse.getRspCode());
}
Response response = new Response(code, iResponse.getRspMsg());
return response;
}
}
\ No newline at end of file
package com.xingdata.pay.neptune.model;
import android.support.annotation.Nullable;
import java.util.Date;
public class Host {
private Integer hostMapId;
@Nullable
private String hostName;
@Nullable
private String hostAddr;
@Nullable
private String hostPort;
@Nullable
private Byte hostStatus;
@Nullable
private String hostCompany;
@Nullable
private String hostLawyer;
@Nullable
private String hostLawyerContact;
@Nullable
private String hostContractNumber;
@Nullable
private Long hostCostsRate;
@Nullable
private Long hostClearDate;
@Nullable
private Long hostTotalAmt;
@Nullable
private String hostKeyWechat;
@Nullable
private String hostKeyAlipay;
@Nullable
private String hostKeyUnipay;
@Nullable
private String hostNotiUrl;
@Nullable
private String hostAcqCode;
private Date updateTime;
private Date createTime;
public Integer getHostMapId() {
return hostMapId;
}
public void setHostMapId(Integer hostMapId) {
this.hostMapId = hostMapId;
}
@Nullable
public String getHostName() {
return hostName;
}
public void setHostName(@Nullable String hostName) {
this.hostName = hostName;
}
@Nullable
public String getHostAddr() {
return hostAddr;
}
public void setHostAddr(@Nullable String hostAddr) {
this.hostAddr = hostAddr;
}
@Nullable
public String getHostPort() {
return hostPort;
}
public void setHostPort(@Nullable String hostPort) {
this.hostPort = hostPort;
}
@Nullable
public Byte getHostStatus() {
return hostStatus;
}
public void setHostStatus(@Nullable Byte hostStatus) {
this.hostStatus = hostStatus;
}
@Nullable
public String getHostCompany() {
return hostCompany;
}
public void setHostCompany(@Nullable String hostCompany) {
this.hostCompany = hostCompany;
}
@Nullable
public String getHostLawyer() {
return hostLawyer;
}
public void setHostLawyer(@Nullable String hostLawyer) {
this.hostLawyer = hostLawyer;
}
@Nullable
public String getHostLawyerContact() {
return hostLawyerContact;
}
public void setHostLawyerContact(@Nullable String hostLawyerContact) {
this.hostLawyerContact = hostLawyerContact;
}
@Nullable
public String getHostContractNumber() {
return hostContractNumber;
}
public void setHostContractNumber(@Nullable String hostContractNumber) {
this.hostContractNumber = hostContractNumber;
}
@Nullable
public Long getHostCostsRate() {
return hostCostsRate;
}
public void setHostCostsRate(@Nullable Long hostCostsRate) {
this.hostCostsRate = hostCostsRate;
}
@Nullable
public Long getHostClearDate() {
return hostClearDate;
}
public void setHostClearDate(@Nullable Long hostClearDate) {
this.hostClearDate = hostClearDate;
}
@Nullable
public Long getHostTotalAmt() {
return hostTotalAmt;
}
public void setHostTotalAmt(@Nullable Long hostTotalAmt) {
this.hostTotalAmt = hostTotalAmt;
}
@Nullable
public String getHostKeyWechat() {
return hostKeyWechat;
}
public void setHostKeyWechat(@Nullable String hostKeyWechat) {
this.hostKeyWechat = hostKeyWechat;
}
@Nullable
public String getHostKeyAlipay() {
return hostKeyAlipay;
}
public void setHostKeyAlipay(@Nullable String hostKeyAlipay) {
this.hostKeyAlipay = hostKeyAlipay;
}
@Nullable
public String getHostKeyUnipay() {
return hostKeyUnipay;
}
public void setHostKeyUnipay(@Nullable String hostKeyUnipay) {
this.hostKeyUnipay = hostKeyUnipay;
}
@Nullable
public String getHostNotiUrl() {
return hostNotiUrl;
}
public void setHostNotiUrl(@Nullable String hostNotiUrl) {
this.hostNotiUrl = hostNotiUrl;
}
@Nullable
public String getHostAcqCode() {
return hostAcqCode;
}
public void setHostAcqCode(@Nullable String hostAcqCode) {
this.hostAcqCode = hostAcqCode;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
\ No newline at end of file
package com.xingdata.pay.neptune.model;
import android.support.annotation.Nullable;
import java.util.Date;
public class Posppp {
private Integer id;
private Integer hostMapId;
@Nullable
private Long opMapId;
@Nullable
private Long channelMapId;
private Long merMapId;
@Nullable
private String hshopName;
@Nullable
private String hshopNameabcn;
private Long casherId;
private String hshopNo;
@Nullable
private String hposNo;
private Byte pppFlag;
@Nullable
private Integer hposBatch;
@Nullable
private Integer hposTrace;
@Nullable
private String hposKey;
private Date updateTime;
private Date createTime;
@Nullable
private String hostName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getHostMapId() {
return hostMapId;
}
public void setHostMapId(Integer hostMapId) {
this.hostMapId = hostMapId;
}
@Nullable
public Long getOpMapId() {
return opMapId;
}
public void setOpMapId(@Nullable Long opMapId) {
this.opMapId = opMapId;
}
@Nullable
public Long getChannelMapId() {
return channelMapId;
}
public void setChannelMapId(@Nullable Long channelMapId) {
this.channelMapId = channelMapId;
}
public Long getMerMapId() {
return merMapId;
}
public void setMerMapId(Long merMapId) {
this.merMapId = merMapId;
}
@Nullable
public String getHshopName() {
return hshopName;
}
public void setHshopName(@Nullable String hshopName) {
this.hshopName = hshopName;
}
@Nullable
public String getHshopNameabcn() {
return hshopNameabcn;
}
public void setHshopNameabcn(@Nullable String hshopNameabcn) {
this.hshopNameabcn = hshopNameabcn;
}
public Long getCasherId() {
return casherId;
}
public void setCasherId(Long casherId) {
this.casherId = casherId;
}
public String getHshopNo() {
return hshopNo;
}
public void setHshopNo(String hshopNo) {
this.hshopNo = hshopNo;
}
@Nullable
public String getHposNo() {
return hposNo;
}
public void setHposNo(@Nullable String hposNo) {
this.hposNo = hposNo;
}
public Byte getPppFlag() {
return pppFlag;
}
public void setPppFlag(Byte pppFlag) {
this.pppFlag = pppFlag;
}
@Nullable
public Integer getHposBatch() {
return hposBatch;
}
public void setHposBatch(@Nullable Integer hposBatch) {
this.hposBatch = hposBatch;
}
@Nullable
public Integer getHposTrace() {
return hposTrace;
}
public void setHposTrace(@Nullable Integer hposTrace) {
this.hposTrace = hposTrace;
}
@Nullable
public String getHposKey() {
return hposKey;
}
public void setHposKey(@Nullable String hposKey) {
this.hposKey = hposKey;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Nullable
public String getHostName() {
return hostName;
}
public void setHostName(@Nullable String hostName) {
this.hostName = hostName;
}
}
\ No newline at end of file
package com.xingdata.pay.neptune.model;
import android.support.annotation.Nullable;
import java.util.Date;
public class Shopppp {
private Integer id;
private Integer hostMapId;
@Nullable
private Long opMapId;
@Nullable
private Long channelMapId;
private Long merMapId;
@Nullable
private String hshopName;
@Nullable
private String hshopNameabcn;
@Nullable
private String hshopNo;
private Byte pppFlag;
@Nullable
private String shopAppidDisp;
@Nullable
private String shopAppidScan;
@Nullable
private String hshopKeyWechat;
@Nullable
private String hshopKeyAlipay;
@Nullable
private String hshopKeyUnipay;
private Date updateTime;
private Date createTime;
@Nullable
private String hostName;
@Nullable
private Posppp posppp;
@Nullable
private Host host;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getHostMapId() {
return hostMapId;
}
public void setHostMapId(Integer hostMapId) {
this.hostMapId = hostMapId;
}
@Nullable
public Long getOpMapId() {
return opMapId;
}
public void setOpMapId(@Nullable Long opMapId) {
this.opMapId = opMapId;
}
@Nullable
public Long getChannelMapId() {
return channelMapId;
}
public void setChannelMapId(@Nullable Long channelMapId) {
this.channelMapId = channelMapId;
}
public Long getMerMapId() {
return merMapId;
}
public void setMerMapId(Long merMapId) {
this.merMapId = merMapId;
}
@Nullable
public String getHshopName() {
return hshopName;
}
public void setHshopName(@Nullable String hshopName) {
this.hshopName = hshopName;
}
@Nullable
public String getHshopNameabcn() {
return hshopNameabcn;
}
public void setHshopNameabcn(@Nullable String hshopNameabcn) {
this.hshopNameabcn = hshopNameabcn;
}
@Nullable
public String getHshopNo() {
return hshopNo;
}
public void setHshopNo(@Nullable String hshopNo) {
this.hshopNo = hshopNo;
}
public Byte getPppFlag() {
return pppFlag;
}
public void setPppFlag(Byte pppFlag) {
this.pppFlag = pppFlag;
}
@Nullable
public String getShopAppidDisp() {
return shopAppidDisp;
}
public void setShopAppidDisp(@Nullable String shopAppidDisp) {
this.shopAppidDisp = shopAppidDisp;
}
@Nullable
public String getShopAppidScan() {
return shopAppidScan;
}
public void setShopAppidScan(@Nullable String shopAppidScan) {
this.shopAppidScan = shopAppidScan;
}
@Nullable
public String getHshopKeyWechat() {
return hshopKeyWechat;
}
public void setHshopKeyWechat(@Nullable String hshopKeyWechat) {
this.hshopKeyWechat = hshopKeyWechat;
}
@Nullable
public String getHshopKeyAlipay() {
return hshopKeyAlipay;
}
public void setHshopKeyAlipay(@Nullable String hshopKeyAlipay) {
this.hshopKeyAlipay = hshopKeyAlipay;
}
@Nullable
public String getHshopKeyUnipay() {
return hshopKeyUnipay;
}
public void setHshopKeyUnipay(@Nullable String hshopKeyUnipay) {
this.hshopKeyUnipay = hshopKeyUnipay;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Nullable
public String getHostName() {
return hostName;
}
public void setHostName(@Nullable String hostName) {
this.hostName = hostName;
}
@Nullable
public Posppp getPosppp() {
return posppp;
}
public void setPosppp(@Nullable Posppp posppp) {
this.posppp = posppp;
}
@Nullable
public Host getHost() {
return host;
}
public void setHost(@Nullable Host host) {
this.host = host;
}
}
\ No newline at end of file
<resources>
<string name="app_name">neptune</string>
</resources>
package com.xingdata.pay.neptune;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
......@@ -54,7 +54,9 @@ public class C {
public final static int QUERY = 400;
}
/**
* 支付渠道
*/
public final class PAY_CHANNEL {
public static final int CASH = 1;
public static final int WECHAT = 2;
......@@ -65,13 +67,34 @@ public class C {
}
/**
* 渠道
* 支付系统
*/
static final class HOST {
final class PAY_SYSTEM {
/**
* 浙星
*/
static final int ZX = 100101;
/**
* 惠尔丰平台的渠道编号
* 拉卡拉
*/
final static int PAX = 100000;
static final int LKL = 100201;
/**
* 百富
*/
final class PAX {
/**
* 统一支付APP
*/
static final int APP = 100301;
/**
* 接口
*/
static final int API = 100302;
}
}
/**
......
package com.xingdata.zxpay;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.Utils;
import com.xingdata.zxpay.api.Response;
import com.xingdata.zxpay.model.Shopppp;
import com.xingdata.zxpay.pax.Factory;
import com.xingdata.zxpay.pax.PaxFactory;
import io.reactivex.Observable;
......@@ -19,12 +18,32 @@ public class PayCenter {
}
/**
* 交易基本信息
* 支付系统
*/
public Shopppp mShopppp;
private int mPaySystem;
public PayCenter init(String json) {
mShopppp = JSON.parseObject(json, Shopppp.class);
/**
* 支付信息
*/
public String mShoppppJson;
/**
* 设置支付信息
*/
public PayCenter setPayKey(String json) {
mShoppppJson = json;
return this;
}
/**
* 初始化
*
* @param paySystem 支付系统
* @return this
*/
public PayCenter init(int paySystem) {
this.mPaySystem = paySystem;
return this;
}
......@@ -37,11 +56,11 @@ public class PayCenter {
* @return 支付结果的Observable
*/
public Observable<Response> pay(int payChannel, String payCode, Long orderAmt) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.microPay(payChannel, payCode, Util.fenToYuan(orderAmt));
switch (mPaySystem) {
case C.PAY_SYSTEM.PAX.API:
return PaxFactory.getInstance().microPay(payChannel, payCode, Util.fenToYuan(orderAmt));
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, Utils.getApp().getResources().getString(R.string.unknown_channels)));
}
}
......@@ -54,11 +73,11 @@ public class PayCenter {
* @return 支付结果的Observable
*/
public Observable<Response> pay(int payChannel, Long orderAmt) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.qrPay(payChannel, Util.fenToYuan(orderAmt));
switch (mPaySystem) {
case C.PAY_SYSTEM.PAX.API:
return PaxFactory.getInstance().qrPay(payChannel, Util.fenToYuan(orderAmt));
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, Utils.getApp().getResources().getString(R.string.unknown_channels)));
}
}
......@@ -69,11 +88,11 @@ public class PayCenter {
* @return 查询结果的Observable
*/
public Observable<Response> query(int payChannel) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.query(payChannel);
switch (mPaySystem) {
case C.PAY_SYSTEM.PAX.API:
return PaxFactory.getInstance().query(payChannel);
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, Utils.getApp().getResources().getString(R.string.unknown_channels)));
}
}
}
package com.xingdata.zxpay.api;
public class Factory {
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class Factory {
protected static <T> Observable<T> run(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
}
package com.xingdata.zxpay.pax;
import com.xingdata.zxpay.PayCenter;
class Api extends com.xingdata.zxpay.api.Api {
Service service;
......@@ -21,6 +19,6 @@ class Api extends com.xingdata.zxpay.api.Api {
@Override
protected String getBaseUrl() {
return PayCenter.getInstance().mShopppp.getHost().getHostAddr();
return PaxFactory.getInstance().mShopppp.getHost().getHostAddr();
}
}
......@@ -6,16 +6,6 @@ class C {
*/
static final String VERSION = "V1.0";
/**
* 重试次数
*/
static final int RETRY_COUNT = 6;
/**
* 重试延迟时间
*/
static final int RETRY_DELAY_TIME = 5 * 1000;
/**
* 测试数据
*/
......
......@@ -3,28 +3,45 @@ package com.xingdata.zxpay.pax;
import android.util.SparseArray;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.TimeUtils;
import com.xingdata.zxpay.PayCenter;
import com.xingdata.zxpay.api.RetryHelper;
import com.xingdata.zxpay.model.Shopppp;
import java.text.SimpleDateFormat;
import java.util.Locale;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class Factory extends com.xingdata.zxpay.api.Factory {
public class PaxFactory extends com.xingdata.zxpay.api.Factory {
private static SimpleDateFormat format = new SimpleDateFormat("yyyymmddhhmmss", Locale.getDefault());
private static SparseArray<String> orderMap = new SparseArray<>();
private PaxFactory() {
mShopppp = JSON.parseObject(PayCenter.getInstance().mShoppppJson, Shopppp.class);
}
private static class PaxFactoryHolder {
private static final PaxFactory INSTANCE = new PaxFactory();
}
public static <T> Observable<T> run(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(C.RETRY_COUNT, C.RETRY_DELAY_TIME));
public static PaxFactory getInstance() {
return PaxFactory.PaxFactoryHolder.INSTANCE;
}
/**
* 交易基本信息
*/
Shopppp mShopppp;
/**
* 时间
*/
private SimpleDateFormat format = new SimpleDateFormat("yyyymmddhhmmss", Locale.getDefault());
/**
* 订单
*/
private SparseArray<String> orderMap = new SparseArray<>();
/**
* 条码支付
*
......@@ -33,21 +50,21 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
* @param totalAmount 总金额(单位元)
* @return 交易结果
*/
public static Observable<com.xingdata.zxpay.api.Response> microPay(int payChannel, String authCode, String totalAmount) {
public Observable<com.xingdata.zxpay.api.Response> microPay(int payChannel, String authCode, String totalAmount) {
Request request = Request.create(C.METHOD.MICROPAY);
request.setOutTransactionNo(PayCenter.getInstance().mShopppp.getPosppp().getHposTrace());
request.setOutTransactionNo(mShopppp.getPosppp().getHposTrace());
request.setTimeStart(TimeUtils.getNowString(format));
request.setAuthCode(authCode);
request.setTotalAmount(totalAmount);
switch (payChannel) {
case com.xingdata.zxpay.C.PAY_CHANNEL.ALI:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyAlipay());
request.setKey(mShopppp.getHshopKeyAlipay());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.WECHAT:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyWechat());
request.setKey(mShopppp.getHshopKeyWechat());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.BANK:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyUnipay());
request.setKey(mShopppp.getHshopKeyUnipay());
break;
}
request.sign();
......@@ -63,27 +80,26 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
* @param totalAmount 支付金额
* @return 交易结果
*/
public static Observable<com.xingdata.zxpay.api.Response> qrPay(int payChannel, String totalAmount) {
public Observable<com.xingdata.zxpay.api.Response> qrPay(int payChannel, String totalAmount) {
Request request = Request.create(C.METHOD.QRPAY);
request.setOutTransactionNo(PayCenter.getInstance().mShopppp.getPosppp().getHposTrace());
request.setOutTransactionNo(mShopppp.getPosppp().getHposTrace());
request.setTimeStart(TimeUtils.getNowString(format));
request.setTotalAmount(totalAmount);
switch (payChannel) {
case com.xingdata.zxpay.C.PAY_CHANNEL.ALI:
request.setTradeType(C.TRADE_TYPE.ALI);
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyAlipay());
request.setKey(mShopppp.getHshopKeyAlipay());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.WECHAT:
request.setTradeType(C.TRADE_TYPE.WECHAT);
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyWechat());
request.setKey(mShopppp.getHshopKeyWechat());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.BANK:
request.setTradeType(C.TRADE_TYPE.UNION);
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyUnipay());
request.setKey(mShopppp.getHshopKeyUnipay());
break;
}
request.sign();
return run(Api.getInstance().service.action(request))
.map(new ResultFilter())
.doFinally(() -> orderMap.put(request.getOutTransactionNo(), request.getTimeStart()));
......@@ -95,19 +111,19 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
*
* @return 查询结果
*/
public static Observable<com.xingdata.zxpay.api.Response> query(int payChannel) {
public Observable<com.xingdata.zxpay.api.Response> query(int payChannel) {
Request request = Request.create(C.METHOD.QUERY);
request.setOutTransactionNo(PayCenter.getInstance().mShopppp.getPosppp().getHposTrace());
request.setOutTransactionNo(mShopppp.getPosppp().getHposTrace());
request.setTimeStart(orderMap.get(request.getOutTransactionNo()));
switch (payChannel) {
case com.xingdata.zxpay.C.PAY_CHANNEL.ALI:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyAlipay());
request.setKey(mShopppp.getHshopKeyAlipay());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.WECHAT:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyWechat());
request.setKey(mShopppp.getHshopKeyWechat());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.BANK:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyUnipay());
request.setKey(mShopppp.getHshopKeyUnipay());
break;
}
request.sign();
......
......@@ -3,7 +3,6 @@ package com.xingdata.zxpay.pax;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.blankj.utilcode.util.EncryptUtils;
import com.xingdata.zxpay.PayCenter;
class Request {
......@@ -14,9 +13,9 @@ class Request {
this.signType = C.SIGN_TYPE.MD5;
this.version = C.VERSION;
this.agentId = PayCenter.getInstance().mShopppp.getHost().getHostAcqCode();
this.mchId = PayCenter.getInstance().mShopppp.getPosppp().getHshopNo();
this.terId = PayCenter.getInstance().mShopppp.getPosppp().getHposNo();
this.agentId = PaxFactory.getInstance().mShopppp.getHost().getHostAcqCode();
this.mchId = PaxFactory.getInstance().mShopppp.getPosppp().getHshopNo();
this.terId = PaxFactory.getInstance().mShopppp.getPosppp().getHposNo();
}
/**
......@@ -147,7 +146,6 @@ class Request {
@JSONField(name = "sign")
private String sign;
String getVersion() {
return version;
}
......@@ -204,7 +202,6 @@ class Request {
this.timeStart = timeStart;
}
String getSubject() {
return subject;
}
......@@ -213,7 +210,6 @@ class Request {
this.subject = subject;
}
String getBody() {
return body;
}
......@@ -238,7 +234,6 @@ class Request {
this.authCode = authCode;
}
String getCurrency() {
return currency;
}
......@@ -255,7 +250,6 @@ class Request {
this.totalAmount = totalAmount;
}
String getFeeAmount() {
return feeAmount;
}
......@@ -264,7 +258,6 @@ class Request {
this.feeAmount = feeAmount;
}
String getReserved() {
return reserved;
}
......@@ -273,7 +266,6 @@ class Request {
this.reserved = reserved;
}
String getExpTime() {
return expTime;
}
......
......@@ -33,13 +33,27 @@ class Response {
@JSONField(name = "msg")
private String msg;
public Long getTime_start() {
return time_start;
}
public void setTime_start(Long time_start) {
this.time_start = time_start;
}
/**
* 交易时间
*/
@JSONField(name = "time_start")
private Long time_start;
/**
* 二维码地址
*/
@JSONField(name = "code_url")
private String codeUrl;
String getMethod() {
public String getMethod() {
return method;
}
......@@ -47,7 +61,7 @@ class Response {
this.method = method;
}
String getAgentId() {
public String getAgentId() {
return agentId;
}
......@@ -55,7 +69,7 @@ class Response {
this.agentId = agentId;
}
String getMchId() {
public String getMchId() {
return mchId;
}
......@@ -63,7 +77,7 @@ class Response {
this.mchId = mchId;
}
String getCode() {
public String getCode() {
return code;
}
......@@ -71,7 +85,7 @@ class Response {
this.code = code;
}
String getMsg() {
public String getMsg() {
return msg;
}
......@@ -79,7 +93,7 @@ class Response {
this.msg = msg;
}
String getCodeUrl() {
public String getCodeUrl() {
return codeUrl;
}
......
package com.xingdata.zxpay.pax;
import com.alibaba.fastjson.JSON;
import io.reactivex.functions.Function;
class ResultFilter implements Function<Response, com.xingdata.zxpay.api.Response> {
......@@ -24,7 +26,7 @@ class ResultFilter implements Function<Response, com.xingdata.zxpay.api.Response
}
switch (response.getMethod()) {
case C.METHOD.QRPAY:
r.setBody(response.getCodeUrl());
r.setBody(JSON.toJSONString(response));
break;
}
return r;
......
<resources>
<string name="app_name">pay</string>
<string name="unknown_channels">未知渠道</string>
</resources>
include ':app', ':pay'
include ':app', ':pay', ':neptune'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment