def cancel(args)
      args = args['oid'] if args.is_a?(Hash)
      orders = post('/api/1/generic/orders')
      order = orders.detect { |o| o['oid'] == args.to_s }
      if order
        res = post('/api/1/BTCUSD/order/cancel', :oid => order['oid'])
        orders.delete_if { |o| o['oid'] == res['oid'] }
        parse_orders(orders)
      else
        fail(MtGox::OrderNotFoundError)
      end
    end
def cancel(args)
      args = args['oid'] if args.is_a?(Hash)
      orders = post('/api/1/generic/orders')
      order = orders.detect { |o| o['oid'] == args.to_s }
      if order
        res = post('/api/1/BTCUSD/order/cancel', :oid => order['oid'])
        orders.delete_if { |o| o['oid'] == res['oid'] }
        parse_orders(orders)
      else
        fail(MtGox::OrderNotFoundError)
      end
    end
Cancel an open order

 @authenticated true
 @overload cancel(oid)
   @param oid [String] an order ID
   @return [Hash] with keys :buys and :sells, which contain arrays as described in {MtGox::Client#buys} and {MtGox::Clients#sells}
   @example
     my_order = MtGox.orders.first
     MtGox.cancel my_order.oid
     MtGox.cancel 1234567890
 @overload cancel(order)
   @param order [Hash] a hash-like object, containing at least a key `oid` - the order ID of the transaction to cancel
   @return [Hash] with keys :buys and :sells, which contain arrays as described in {MtGox::Client#buys} and {MtGox::Clients#sells}
   @example
     my_order = MtGox.orders.first
     MtGox.cancel my_order
     MtGox.cancel {'oid' => '1234567890'}