anchor.diff:          _:R                  -> {error, R}
       end.
   
  +update_order_for_cancel(Oid) ->
  +	case emysql:execute(mysqlpool,
  +            <<"select o.cost, abs(timestampdiff(hour, now(), order_ontime)) ",
  +            " from orders o where o.id = ?">>, [Oid]) of
  +		{result_packet,_,_,[[Amnt, Hrs]],_} when Hrs < 24 -> 
  +            lager:debug("UOFC < 24 ~p", [Amnt]),
  +            ok;
  +		{result_packet,_,_,[[Amnt, Hrs]],_} when Hrs < 48 -> 
  +            NAmnt = Amnt div 5,
  +            Ur = emysql:execute(mysqlpool, <<"update orders set cost=? where id=?">>, [NAmnt, Oid]),
  +            lager:debug("UOFC < 48 ~p", [{Amnt, NAmnt, Ur}]),
  +            ok;
  +		{result_packet,_,_,[[Amnt, Hrs]],_} when Hrs > 48 ->
  +            lager:debug("UOFC > 48 ~p", [Amnt]),
  +            nok
  +        ;_ -> nok
  +	end.
  +
   update_order_stripe_token(Orderid, Pid1) ->
       emysql:execute(mysqlpool,<<"update orders set payment_status = 0, payment_id=? where id=?">>,[Pid1, Orderid]).
   
  
positive.code:     ,get_order/1
      ,complete_order/2
      ,make_stripe_payment/5
      ,save_stripe_payment/5
  ]).
  
  
negative.code:       true ->
          case lists:member(Status, [<<"pending">>, <<"upcoming">>]) of
              true -> 
                  case make_stripe_cancel_payment(Oid) of
                      {error, Err} -> {error, Err}
                      ;_ ->
                          emysql:execute(mysqlpool,<<"update orders set status = 'cancelled' where uid=? and id=?">>,[Uid, Oid]),
                          orders_queue:update_orders()
                  end
              ;_   -> {error, non_cancel_status}
          end
        ;_ -> {error, another_user_order} 
  