basket minimum price control added before create order
This commit is contained in:
@@ -48,5 +48,6 @@ public class ApiEndPoints {
|
||||
public static final String API_CHECK_COUPON = PREFIX + "checkCoupon" + SUFFIX + "&token=";
|
||||
public static final String API_CREATE_PAYMENT = PREFIX + "checkBrainTreePayment" + SUFFIX + "&token=";
|
||||
public static final String API_REPEAT_ORDER = PREFIX + "reOrder" + SUFFIX + "&token=";
|
||||
public static final String API_CHECK_BASKET_BY_MINIMUM_PRICE = PREFIX + "checkBasketByMinimumPrice" + SUFFIX + "&token=";
|
||||
|
||||
}
|
||||
|
||||
@@ -224,8 +224,10 @@ public interface ApiInterface {
|
||||
@GET("{storeName}" + ApiEndPoints.API_GET_DELIVERY_TIME_OF_STORE)
|
||||
Call<ResponseObject<StoreShiftModel>> getDeliveryTimeOfStore(@Path("storeName") String storeName);
|
||||
|
||||
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST
|
||||
Call<ResponseObject<Boolean>> checkBasketByMinimumPriceOfStore(@Url String url,
|
||||
@FieldMap HashMap<String, Object> body);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
|
||||
createOrderActivity.onPreviousClicked(FRAGMENT_NAME);
|
||||
break;
|
||||
case R.id.nextTextView:
|
||||
checkDeliveryTime();
|
||||
checkBasketByMinimumPriceOfStore();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -186,6 +186,47 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
|
||||
orderProductsRecyclerView.setAdapter(productOnOrderSummaryRecyclerAdapter);
|
||||
}
|
||||
|
||||
private void checkBasketByMinimumPriceOfStore(){
|
||||
|
||||
DialogHelper.showLoadingDialog();
|
||||
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("customer_id", SessionHelper.getUser().getId());
|
||||
params.put("shipping_method_title", createOrderActivity.getSelectedShippingMethod().getTitle());
|
||||
params.put("shipping_method_code", createOrderActivity.getSelectedShippingMethod().getCode());
|
||||
params.put("address_id", createOrderActivity.getSelectedShippingAddress().getId());
|
||||
params.put("payment_method_title", createOrderActivity.getSelectedPaymentMethod().getTitle());
|
||||
params.put("payment_method_code", createOrderActivity.getSelectedPaymentMethod().getCode());
|
||||
params.put("comment", createOrderNote());
|
||||
params.put("is_pizza_pass_campaign", createOrderActivity.getCartInfo().isPizzapassCampaignUsed());
|
||||
params.put("is_champagne_campaign", createOrderActivity.getCartInfo().isChampagneCampaignUsed());
|
||||
if(SessionHelper.getSelectedCoupon() != null){
|
||||
params.put("coupon", SessionHelper.getSelectedCoupon().getCode());
|
||||
}
|
||||
|
||||
Call<ResponseObject<Boolean>> call = ApiService.apiInterface.checkBasketByMinimumPriceOfStore(
|
||||
"/" + SessionHelper.getSelectedStore().getStoreName() + ApiEndPoints.API_CHECK_BASKET_BY_MINIMUM_PRICE + SessionHelper.getCustomerToken().getToken(), params);
|
||||
call.enqueue(new Callback<ResponseObject<Boolean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseObject<Boolean>> call, Response<ResponseObject<Boolean>> response) {
|
||||
if(response.isSuccessful() && response.body().isSuccess()){
|
||||
checkDeliveryTime();
|
||||
}
|
||||
else{
|
||||
DialogHelper.hideLoadingDialog();
|
||||
ApiErrorUtils.parseError(response);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ResponseObject<Boolean>> call, Throwable t) {
|
||||
DialogHelper.hideLoadingDialog();
|
||||
DialogHelper.showFailedDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void checkDeliveryTime(){
|
||||
ApiService
|
||||
.apiInterface
|
||||
|
||||
Reference in New Issue
Block a user