def refresh
      payment = Spree::Payment.find(params[:payment])  # Retrieve payment by ID
      old_state = payment.state
      payment.process_bitpay_ipn
      new_state = payment.reload.state
      notice = (new_state == old_state) ? Spree.t(:bitpay_payment_not_updated) : (Spree.t(:bitpay_payment_updated) + new_state.titlecase)
      redirect_to (request.referrer || root_path), notice: notice
    end
def refresh
      payment = Spree::Payment.find(params[:payment])  # Retrieve payment by ID
      old_state = payment.state
      payment.process_bitpay_ipn
      new_state = payment.reload.state
      notice = (new_state == old_state) ? Spree.t(:bitpay_payment_not_updated) : (Spree.t(:bitpay_payment_updated) + new_state.titlecase)
      redirect_to (request.referrer || root_path), notice: notice
    end
Reprocess Invoice and update order status